Skip to content

Commit 645a573

Browse files
author
Federico Fissore
committed
delete OLDYahooWeather example
Updated pretty-wifi-info-lua path in ShellCommands and WifiStatus examples Tried to make a sense of HttpClient example by making it fetch http://arduino.cc/asciilogo.txt
1 parent 0acfdbc commit 645a573

File tree

4 files changed

+11
-104
lines changed

4 files changed

+11
-104
lines changed

hardware/arduino/avr/libraries/Bridge/examples/HttpClient/HttpClient.ino

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ void setup() {
55
pinMode(13, OUTPUT);
66
digitalWrite(13, LOW);
77
Bridge.begin();
8+
Serial.begin(9600);
9+
while(!Serial);
810
}
911

1012
void loop() {
1113
HttpClient client;
12-
client.get("http://my.server.address/file.php");
14+
client.get("http://arduino.cc/asciilogo.txt");
1315

14-
char c = client.read();
15-
if (c=='1')
16-
digitalWrite(13, HIGH);
17-
if (c=='0')
18-
digitalWrite(13, LOW);
16+
while (client.available()) {
17+
char c = client.read();
18+
Serial.print(c);
19+
}
20+
Serial.flush();
1921

2022
delay(5000);
2123
}

hardware/arduino/avr/libraries/Bridge/examples/OLDYahooWeather/OLDYahooWeather.ino

Lines changed: 0 additions & 94 deletions
This file was deleted.

hardware/arduino/avr/libraries/Bridge/examples/ShellCommands/ShellCommands.ino

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
Running shell commands using Process class.
43
@@ -32,10 +31,10 @@ void setup() {
3231

3332
void loop() {
3433
Process p;
35-
// This command line runs the wifiCheck script, (lua /arduino/pretty...), then
34+
// This command line runs the WifiStatus script, (/usr/bin/pretty-wifi-info.lua), then
3635
// sends the result to the grep command to look for a line containing the word
3736
// "Signal:" the result is passed to this sketch:
38-
p.runShellCommand("lua /arduino/pretty_wifi_info.lua | grep Signal");
37+
p.runShellCommand("/usr/bin/pretty-wifi-info.lua | grep Signal");
3938

4039
// do nothing until the process finishes, so you get the whole output:
4140
while(p.running());

hardware/arduino/avr/libraries/Bridge/examples/WiFiStatus/WiFiStatus.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
WiFi Status
44
55
This sketch run a script already present on your Yún in the
6-
/arduino directory called "pretty_wifi_info.lua" that takes
6+
/usr/bin directory called "pretty-wifi-info.lua" that takes
77
the informations of the WiFi interface and print it on the
88
Serial monitor.
99

0 commit comments

Comments
 (0)