int num 1 void setup Serial begin115200 delay200
데이터 읽기 명령어 추가하기 int num = -1; void setup() { Serial. begin(115200); delay(200); void loop() { //30 sec num = (num + 1) % 30; Serial. println(num); wifi. begin(9600); delay(500); String s = wifi. Wi. Fi. Read(); wifi. SSID("Hello. Apps"); delay(200); Serial. print(wifi. Message()); if (s. length() > 0) { Serial. println(s); } wifi. Password("Hello. Apps"); delay(200); Serial. print(wifi. Message()); wifi. Connect. AP(); delay(500); Serial. print(wifi. Message()); wifi. Host("spl 3 d. azurewebsites. net"); delay(200); Serial. print(wifi. Message()); if (num == 0) { int a 0 = analog. Read(0); wifi. Send(a 0); wifi. Port("80"); delay(200); Serial. print(wifi. Message()); wifi. Path("/iot/data. aspx"); delay(200); Serial. print(wifi. Message()); delay(500) Serial. print(wifi. Message()); Serial. println("http: //spl 3 d. azurewebsites. net/iot/data. aspx"); } wifi. User. ID("12345"); delay(200); Serial. print(wifi. Message()); } delay(1000); } 헬로앱스 (www. helloapps. co. kr) 4
인터넷으로 LED 제어하기 int num = -1; void loop() { //30 sec num = (num + 1) % 30; Serial. println(num); void setup() { Serial. begin(115200); delay(200); String s = wifi. Wi. Fi. Read(); wifi. begin(9600); delay(500); if (s. length() > 0) { Serial. println(s); wifi. SSID("Hello. Apps"); delay(200); Serial. print(wifi. Message()); wifi. Password("Hello. Apps"); delay(200); Serial. print(wifi. Message()); if (s == "on") digital. Write(13, HIGH); else if (s == "off") digital. Write(13, LOW); wifi. Connect. AP(); delay(500); Serial. print(wifi. Message()); } wifi. Host("spl 3 d. azurewebsites. net"); delay(200); Serial. print(wifi. Message()); wifi. Port("80"); delay(200); Serial. print(wifi. Message()); if (num == 0) { int a 0 = analog. Read(0); wifi. Send(a 0); wifi. Path("/iot/data. aspx"); delay(200); Serial. print(wifi. Message()); delay(500) Serial. print(wifi. Message()); Serial. println("http: //spl 3 d. azurewebsites. net/iot/data. aspx"); wifi. User. ID("12345"); delay(200); Serial. print(wifi. Message()); } } delay(1000); } 헬로앱스 (www. helloapps. co. kr) 10
- Slides: 10