Advertisement
Guest User

INTELIGENTNY POKÓJ 1.0

a guest
Feb 16th, 2017
2,309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.36 KB | None | 0 0
  1. //BIBLIOTEKI
  2. #include <SPI.h> //SPI
  3. #include <Ethernet2.h> //INTERNET
  4. #include <TimeLib.h> //CZAS
  5. #include <Wire.h> //KOMUNIKACJA CZAS
  6. #include <DS1307RTC.h> //ZEGAR
  7. #include <IRremote.h> //WYJŚCIE DIODY IR MEGA PIN 9 (OC2B)
  8.  
  9. IRsend irsend; //AKTYWACJA DIODY IR
  10. byte mac[] = {0x90, 0xA2, 0xDA, 0x10, 0x57, 0xB7}; //ADRES MAC
  11. IPAddress ip(192, 168, 0, 120); //IP SERWERA
  12. EthernetServer server(80); //PORT SERWERA (W TYM WYPADKU HTTP)
  13.  
  14. //STRING
  15. String dane; //STRING ZAPISUJACY DANE Z SERWERA
  16. String DOOR = ""; //STRING CZUJNIK DRZWI
  17. String WINDOWUP = ""; //STRING CZUJNIK OKNO DACHOWE
  18. String WINDOW = ""; //STRING CZUJNIK OKNO GŁÓWNE
  19. String LIGHT = ""; //STRING CZUJNIK ŚWIATŁO
  20. String BIURKO1 = "OFF"; //STRING STANU ŚWIATŁA BIURKO
  21. String SWIATLO1 = "OFF"; //STRING STANU ŚWIATŁA OGÓLNEGO
  22. //_______________________________________________________________________________________________________________________________________________________________________________________________________________________________
  23. void setup()
  24. {
  25. pinMode(49, INPUT_PULLUP); // WŁĄCZENIE PINU CZUJNIKA DRZWI
  26. pinMode(47, INPUT_PULLUP); // WŁĄCZENIE PINU CZUJNIKA OKNO DACHOWE
  27. pinMode(45, INPUT_PULLUP); // WŁĄCZENIE PINU CZUJNIKA OKNO GÓWNE
  28. pinMode(43, INPUT_PULLUP); // WŁĄCZENIE PINU CZUJNIKA ŚWIATŁO
  29. pinMode(33, OUTPUT); // WŁĄCZENIE PINU BIURKA
  30. pinMode(31, OUTPUT); // WŁĄCZENIE PINU LAMPY
  31.  
  32. setSyncProvider(RTC.get); //ZEBRANIE CZASU
  33. setTime(20,11,0,16,2,2017); //USTAWIENIE CZASU I DATY
  34. Serial.begin(9600); //SERIAL START
  35. Ethernet.begin(mac, ip); //ETHERNET START
  36. server.begin(); //START SERWERA
  37. Serial.print("SERWER JEST DOSTEPNY: "); //TEST IP
  38. Serial.println(Ethernet.localIP()); //TEST IP
  39. }
  40. //_______________________________________________________________________________________________________________________________________________________________________________________________________________________________
  41.  
  42. void loop() {
  43. //IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
  44. //ODCZYT STANU CZUJNIKOW
  45. int DRZWI= digitalRead(49); //ODCZYT STANU CZUJNIKA
  46. int OKNODACH= digitalRead(47); //ODCZYT STANU CZUJNIKA
  47. int OKNO= digitalRead(45); //ODCZYT STANU CZUJNIKA
  48. int SWIATLO= digitalRead(43); //ODCZYT STANU CZUJNIKA
  49.  
  50. if (DRZWI == HIGH) //WYSWIETLENIE STANU CZUJNIKA DRZWI (PRZYKŁAD)
  51. { //
  52. DOOR.remove(35); //USUŃ 35 ZNAKÓW ZE STRING CZUJNIK DRZWI
  53. DOOR = "<font color='green'>OTWARTE</font>"; //DODAJ DO STRING CZUJNIK DRZWI FORMUŁĘ OTWARTE W KOLORZE ZIELONY
  54. } //
  55. else //W INNYM WYPADKU:
  56. { //
  57. DOOR.remove(35); //USUŃ 35 ZNAKÓW ZE STRING CZUJNIK DRZWI
  58. DOOR = "ZAMKNIETE"; //DODAJ DO STRING CZUJNIK DRZWI FORMUŁĘ ZAMKNIETE
  59. } //
  60.  
  61. if (OKNODACH == HIGH)
  62. {
  63. WINDOWUP.remove(35);
  64. WINDOWUP = "<font color='green'>OTWARTE</font>";
  65. }
  66. else
  67. {
  68. WINDOWUP.remove(35);
  69. WINDOWUP = "ZAMKNIETE";
  70. }
  71.  
  72. if (OKNO == HIGH)
  73. {
  74. WINDOW.remove(35);
  75. WINDOW = "<font color='green'>OTWARTE</font>";
  76. }
  77. else
  78. {
  79. WINDOW.remove(35);
  80. WINDOW = "ZAMKNIETE";
  81. }
  82.  
  83. if (SWIATLO == HIGH)
  84. {
  85. LIGHT.remove(36);
  86. LIGHT = "ZGASZONE";
  87. }
  88. else
  89. {
  90. LIGHT.remove(36);
  91. LIGHT = "<font color='green'>ZAPALONE</font>";
  92. }
  93. //IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
  94. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  95. //USTAWIENIA CZASOWE
  96. /*if (hour() == godzina && minute() == minuty)
  97. {
  98. digitalWrite (pin,stan);
  99. }
  100. */
  101. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  102. //..............................................................................................................................................................................................................................
  103. //INTERNET LAN
  104. EthernetClient client = server.available();
  105. if (client) {
  106. Serial.println("NOWY KLIENT");
  107. boolean currentLineIsBlank = true;
  108. while (client.connected())
  109. {
  110. if (client.available())
  111. {
  112. char c = client.read(); // ODBIERANIE DANYCH
  113. dane += c; // ZAPIS DANYCH
  114. Serial.write(c); // WYSWIETLANIE DANYCH
  115. if (c == '\n' && currentLineIsBlank)
  116. {
  117. //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  118. //STANDARTOWA ODPOWIEDŹ BEZ REFRESH
  119. client.println("HTTP/1.1 200 OK");
  120. client.println("Content-Type: text/html");
  121. client.println("Connection: close");
  122. client.println();
  123. client.println("<!DOCTYPE HTML>");
  124. //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  125. //WSTĘP STRONY WWW
  126. client.println("<head><title>POKOJ</title></head>");
  127. client.println("<meta http-equiv=Content-Type content='text/html; charset=iso-8859-2'>");
  128. client.println("<body bgcolor='black' text='red'>");
  129. client.println("<form method='get'>");
  130. //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  131. //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  132. //TABELA 1 DATA GODZINA WŁĄCZNIKI
  133. client.println("<table border='1' align='left'>");
  134.  
  135. client.println("<tr>");
  136. client.println("<td align='center' width='150' height='50'>DATA:</td>");
  137. client.println("<td align='center' width='150' height='50'>");
  138. client.println(year());
  139. client.println("</td>");
  140. client.println("<td align='center' width='150' height='50'>");
  141. client.println(month());
  142. client.println("</td>");
  143. client.println("<td align='center' width='150' height='50'>");
  144. client.println(day());
  145. client.println("</td>");
  146. client.println("<td align='center' width='150' height='50'><input type='submit' value='ON' name='TV'></td>");
  147. client.println("<td align='center' width='150' height='50'><input type='submit' value='INPUT' name='TV'></td>");
  148. client.println("<td align='center' width='150' height='50'><input type='submit' value='MENU' name='TV'></td>");
  149. client.println("</tr>");
  150.  
  151. client.println("<tr>");
  152. client.println("<td align='center' width='150' height='50'>GODZINA:</td>");
  153. client.println("<td align='center' width='150' height='50'>");
  154. client.println(hour());
  155. client.println("</td>");
  156. client.println("<td align='center' width='150' height='50'>");
  157. client.println(minute());
  158. client.println("</td>");
  159. client.println("<td align='center' width='150' height='50'>");
  160. client.println(second());
  161. client.println("</td>");
  162. client.println("<td align='center' width='150' height='50'></td>");
  163. client.println("<td align='center' width='150' height='50'><input type='submit' value='GORA' name='TV'></td>");
  164. client.println("<td align='center' width='150' height='50'></td>");
  165. client.println("</tr>");
  166.  
  167. client.println("<tr>");
  168. client.println("<td align='center' width='150' height='50'>BIURKO</td>");
  169. client.println("<td align='center' width='150' height='50'>");
  170. client.println(BIURKO1);
  171. client.println("</td>");
  172. client.println("<td align='center' width='150' height='50'><input type='submit' value='ON' name='BIURKO'></td>");
  173. client.println("<td align='center' width='150' height='50'><input type='submit' value='OFF' name='BIURKO'></td>");
  174. client.println("<td align='center' width='150' height='50'><input type='submit' value='LEWA' name='TV'></td>");
  175. client.println("<td align='center' width='150' height='50'><input type='submit' value='OK' name='TV'></td>");
  176. client.println("<td align='center' width='150' height='50'><input type='submit' value='PRAWA' name='TV'></td>");
  177. client.println("</tr>");
  178.  
  179. client.println("<tr>");
  180. client.println("<td align='center' width='150' height='50'>SWIATLO</td>");
  181. client.println("<td align='center' width='150' height='50'>");
  182. client.println(SWIATLO1);
  183. client.println("</td>");
  184. client.println("<td align='center' width='150' height='50'><input type='submit' value='ON' name='SWIATLO'></td>");
  185. client.println("<td align='center' width='150' height='50'><input type='submit' value='OFF' name='SWIATLO'></td>");
  186. client.println("<td align='center' width='150' height='50'></td>");
  187. client.println("<td align='center' width='150' height='50'><input type='submit' value='DOL' name='TV'></td>");
  188. client.println("<td align='center' width='150' height='50'><input type='submit' value='EXIT' name='TV'></td>");
  189. client.println("</tr>");
  190.  
  191. client.println("</table>");
  192. //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  193. //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  194. //TEBELA 2 STAN CZUJNIKÓW
  195. client.println("<table border='1' align='right'>");
  196.  
  197. client.println("<tr>");
  198. client.println("<td align='center' width='150' height='50'>CZUJNIK</td>");
  199. client.println("<td align='center' width='150' height='50'>STAN</td>");
  200. client.println("</tr>");
  201.  
  202. client.println("<tr>");
  203. client.println("<td align='center' width='150' height='50'>DRZWI</td>");
  204. client.println("<td align='center' width='150' height='50'>");
  205. client.println(DOOR);
  206. client.println("</td>");
  207. client.println("</tr>");
  208.  
  209. client.println("<tr>");
  210. client.println("<td align='center' width='150' height='50'>OKNO DACH</td>");
  211. client.println("<td align='center' width='150' height='50'>");
  212. client.println(WINDOWUP);
  213. client.println("</td>");
  214. client.println("</tr>");
  215.  
  216. client.println("<tr>");
  217. client.println("<td align='center' width='150' height='50'>OKNO</td>");
  218. client.println("<td align='center' width='150' height='50'>");
  219. client.println(WINDOW);
  220. client.println("</td>");
  221. client.println("</tr>");
  222.  
  223. client.println("<tr>");
  224. client.println("<td align='center' width='150' height='50'>SWIATLO</td>");
  225. client.println("<td align='center' width='150' height='50'>");
  226. client.println(LIGHT);
  227. client.println("</td>");
  228. client.println("</tr>");
  229.  
  230. client.println("</table>");
  231. //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  232. //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  233. //KONEC WWW
  234. client.println("</form></body></html>");
  235. //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  236. break;
  237. } //KONIEC ODPOWIEDZI
  238.  
  239. if (c == '\n')
  240. {
  241. //NOWA LINIA
  242. currentLineIsBlank = true;
  243. }
  244. else if (c != '\r')
  245. {
  246. //NOWY ZNAK
  247. currentLineIsBlank = false;
  248. }
  249. } //KONIEC client.available
  250. } //KONIEC client.connected
  251. delay(1); //ODCZEKANIE NA PRZEJŚCIE DANYCH
  252. client.stop();
  253. Serial.println("ROZLOCZONO");
  254. } // KONIEC client
  255. //..............................................................................................................................................................................................................................
  256. //((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
  257. //PROGRAM TV
  258. if(dane.indexOf("/?TV=ON HTTP/1.1") > 0) //ZNALEZIENIE FRAGMENTU ZAPYTANIA KTÓRE URUCHAMIA TV (PRZYKŁDOWO)
  259. { //
  260. for (int i = 0; i < 3; i++) //PĘTLA POWTÓRZENIA KODU NADANIA IR (EKSPERYMENTALNIE, PRZY 1-KROTNYM URUCHOMIENIU TV NIE ŁAPAŁO)
  261. { //
  262. Serial.println("ON"); //TEST SERIAL
  263. irsend.sendNEC(551489775, 32); //WYSYŁKA KODU IR
  264. delay(30); //PRZERWA MIEDZY KOLEJNYMI WYSYŁKAMI KODU IR
  265. } //
  266. dane=""; //WYCZYSZCZENIE DANYCH ODEBRANYCH ZE STRONY (BEZ TEGO KOD BYŁ CIĄGLE POWTARZANY GDYŻ W STRING dane DANE CIĄGLE ISTNIAŁY I BYŁY WYKRYWANE)
  267. } //
  268.  
  269. if(dane.indexOf("/?TV=INPUT HTTP/1.1") > 0)
  270. {
  271. for (int i = 0; i < 3; i++)
  272. {
  273. Serial.println("INPUT");
  274. irsend.sendNEC(551538735, 32);
  275. delay(30);
  276. }
  277. dane="";
  278. }
  279.  
  280. if(dane.indexOf("/?TV=MENU HTTP/1.1") > 0)
  281. {
  282. for (int i = 0; i < 3; i++)
  283. {
  284. Serial.println("MENU");
  285. irsend.sendNEC(551535165, 32);
  286. delay(30);
  287. }
  288. dane="";
  289. }
  290.  
  291. if(dane.indexOf("/?TV=GORA HTTP/1.1") > 0)
  292. {
  293. Serial.println("GORA");
  294. irsend.sendNEC(551486205, 32);
  295. delay(30);
  296. dane="";
  297. }
  298.  
  299. if(dane.indexOf("/?TV=DOL HTTP/1.1") > 0)
  300. {
  301. Serial.println("DOL");
  302. irsend.sendNEC(551518845, 32);
  303. delay(30);
  304. dane="";
  305. }
  306.  
  307. if(dane.indexOf("/?TV=LEWA HTTP/1.1") > 0)
  308. {
  309. Serial.println("LEWA");
  310. irsend.sendNEC(551542815, 32);
  311. delay(30);
  312. dane="";
  313. }
  314.  
  315. if(dane.indexOf("/?TV=PRAWA HTTP/1.1") > 0)
  316. {
  317. Serial.println("PRAWA");
  318. irsend.sendNEC(551510175, 32);
  319. delay(30);
  320. dane="";
  321. }
  322.  
  323. if(dane.indexOf("/?TV=OK HTTP/1.1") > 0)
  324. {
  325. for (int i = 0; i < 3; i++)
  326. {
  327. Serial.println("OK");
  328. irsend.sendNEC(551494365, 32);
  329. delay(30);
  330. }
  331. dane="";
  332. }
  333.  
  334. if(dane.indexOf("/?TV=EXIT HTTP/1.1") > 0)
  335. {
  336. for (int i = 0; i < 3; i++)
  337. {
  338. Serial.println("EXIT");
  339. irsend.sendNEC(551541285, 32);
  340. delay(30);
  341. }
  342. dane="";
  343. }
  344. //((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
  345. //))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
  346. //PROGRAM WŁĄCZNIKÓW
  347. if(dane.indexOf("?BIURKO=ON HTTP/1.1") > 0) //ZNALEZIENIE FRAGMENTU ZAPYTANIA KTÓRE URUCHAMIA LAMPKE NA BIURKU (PRZYKŁDOWO)
  348. { //
  349. digitalWrite (33,HIGH); //USTAW PIN LAMPKI NA WYSOKI
  350. BIURKO1.remove(30); //USUŃ 30 ZNAKÓW ZE STANU ŚWIATŁA BIURKO
  351. BIURKO1 = "<font color='green'>ON</font>"; //DODAJ DO STRING STANU ŚWIATŁA BIURKO FORMUŁĘ ON W KOLORZE ZIELONY
  352. delay(1000); //ODCZEKAJ 1 SEKUNDĘ
  353. Serial.println("BIURKO=ON"); //TEST SERIAL
  354. dane=""; //WYCZYŚĆ DANE STRONY WWW
  355. } //
  356.  
  357. if(dane.indexOf("/?BIURKO=OFF HTTP/1.1") > 0)
  358. {
  359. digitalWrite (33,LOW);
  360. BIURKO1.remove(30);
  361. BIURKO1 = "OFF";
  362. delay(1000);
  363. Serial.println("BIURKO=OFF");
  364. dane="";
  365. }
  366. if(dane.indexOf("/?SWIATLO=ON HTTP/1.1") > 0)
  367. {
  368. digitalWrite (31,HIGH);
  369. SWIATLO1.remove(30);
  370. SWIATLO1 = "<font color='green'>ON</font>";
  371. delay(1000);
  372. Serial.println("SWIATLO=ON");
  373. dane="";
  374. }
  375. if(dane.indexOf("/?SWIATLO=OFF HTTP/1.1") > 0)
  376. {
  377. digitalWrite (31,LOW);
  378. SWIATLO1.remove(30);
  379. SWIATLO1 = "OFF";
  380. delay(1000);
  381. Serial.println("SWIATLO=OFF");
  382. dane="";
  383. }
  384. //))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
  385.  
  386. }// KONIEC void loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement