??????? ?????? ???????? ?? ???????????? ?????. ?? ?? ??????? ????? ?????????????? . ????? ?? ???????? ????? 912 ????, uint8_t AD; t VOLT; uintl6 const uint8 t Init[24] ={ // OxAE, OxlF, // Display OFF 0xA8, 0x00, 0x22, 0x01, 0x03 set multiplex (HEIGHT-1): OxlF for 128x32, 0x3F for 128x64 0x20, 0x02, OxDA, 0x14, // r II Page min to max 0x00 Horizontal 0x8D, 0x00, // mode 0xD3, OxFF, // Memory addressing configuration 0x01 Vertical 0x81, OxFl, // hardware 0xD9, 0x40, // Set COM Pins to sequential OxDB, 0x00, // 0x21, // Charge pump enabled OxAF, // to 0x7F Display offset 0 Di .spla Set contrast Set pre-charge period Set vcom detect }; #define PI2C_SDA PB0 #define #define PI2C_SCL PBl #define #define OUT_REG PORTB #define #define SDA_ON (OUT_REG |= (1« PI2C_SDA) ) #define #define SDAJDFF (OUT_REG &= -(1« PI2C_SDA) ) ) SCL_ON (OUT_REG |= (1« PI2C_SCL) ) write SCL_OFF (OUT_REG &= -(1« PI2C_SCL) SDA_READ (PINB & (1«PI2C_SDA) ) ADDR ObOllllOOO //OLED Address plus bit https://www.hackster.io/bitbanging/oled-display-driven-by-attinylO-986571
inline void dly() { //?????? ??????? asm (\"NOP\") ; }; void setup () { ADMUX = 2 « MUXO; // ADC1 (PBl) ADCSRA = 1 « ADEN | 3 « ADPSO; // Enable ADC, 125kHz clock DDRB = 3; i = 0; i < 100; i++) dly(); i = 0; i < 24; i++) for (uint8_t start () ; Tx(ADDR); Tx(0x00) ; for (uint8_t { Tx(Init[i]); } stop() ; } void loop(void) { uint8_t buffer[8] = {0, 0, 10, 0, 0, 11, 12, 12}; //???????? ?????? ?? 8 ?????. | 1 « ADSC; // Start ADCSRA = ADCSRA // Wait while //?????? ??? while (ADCSRA & 1 « ADSC); conversion in progress AD = ADCL; VOLT = (AD *47)/10; //??????????? ???????? ??? ? ?????? buffer[0] = VOLT / 1000; / 100; //?????? ???? buffer[1] % 1000) / 10; //?????? ???? buffer[3] = (VOLT % 100) //?????? ???? buffer[4] = (VOLT //????????? % 10; ???? = VOLT OLED printB(buffer); //??????? ?????? ????? ? ?????????: const uint8 t OLED FONT[] PR ={ // 0 0 0x7F, 0x41, r 0x7F, // 1 1 , 0x7F, // 2 2 0x00, 0x00, r 0x4F, // 3 3 T 0x7F, // 4 4 0x79, 0x49, T 0x7E, // 5 5 , 0x79, // 6 6 0x41, 0x49, , 0x79, // 7 7 , 0x7F, // 8 8 OxOF, 0x08, , 0x7F, // 9 9 T 0x7F, // . 10 0x4F, 0x49, r 0x00, // V 11 T OxlF, // - 12 0x7F, 0x49, r 0x00, 0x03, 0x01, 0x7F, 0x49, 0x4F, 0x49, 0x00, 0x60, OxlF, 0x78, 0x00, 0x00, };
void OLED printB(uint8 t *buffer) { start () ; Tx(ADDR); Tx(0x40) ; for (uint8_t i 0; i < 8; i++) OLED_printD(buffer[i]); // print buffer stop() ; // stop transmission uint8 t OLED stretch(uint8 t b) | (b & 1) b = ((b & 2) « 3) // split 2 LSB into the nibbles // double the bits = 4 times b |= b « 1; // double // return them again b |= b « 2; the value return b; } void OLED_printD(uint8_t ch) { uint8_t i, j, ?, b; // loop variables uint8_t sb[4] ; // stretched character bytes ch += ch « 1; // calculate position of character in font array for (i = 8; i; i--) Tx(0x00); // print spacing between characters character for (i = 3; i; i —) { // font has 3 bytes per b = OLED_FONT[ch++]; // read character byte for (j = 0; j < 4; j++, b »= 2) sb[j] = OLED stretch(b); // stretch 4 times j = 4; if (i == 2) j = 6; // calculate x-stretch value while (j--) { // write several times (x-direction) for (k = 0; ? < 4; k++) Tx(sb[k]); // the 4 stretched bytes (y-direction) } ?????? ? 1?: /* i2c start sequence */ void start() */ { SDA_ON ; dly(); SCL_ON ; dly(); SDAJDFF; dly(); SCL_OFF; dly(); } /* i2c stop sequence void stop() { SDAJDFF; dly(); SCL_ON ; dly(); SDA_ON ; dly(); /* Transmit 8 bit data to slave */ bool Tx(uint8 t dat) {
for (uint8_t i = 0; i < 8; i++) { (dat & 0x80) ? SDA_ON : SDA_OFF; dat «= 1; dly() ; SCL_ON; dly() ; SCLJDFF; } SDA_ON ; = !SDA_READ; // Acknowledge bit SCL_ON; dly(); bool ack SCLJDFF; ack; return ???? ?????? ???? ? ?????? ? ??????.
??????? 192.168.1.45 Greg <- ? 192.168.1.45 Temperature is 25.77 °C Humidity is 60.85 % Pressure is 1011.84 mb ???-?????? ?? ARDUINO ???? ? . A. ??? ??????????? ???????? ? ?????????? ??????? ?????? ????????? ??? ???????? ???-??????? ?? Arduino. ???-??????? ?? ????????????????? ????? ???????????? ??????????? ? ???????????? ? ???????? ??? ?????? ????????? ???-???????, ???- ??? ? ??????? ????? ???????? ?? ????????, ??????????? ?? ????? ?????????? ??? ?????????. ??? ???? ??????????? ???-???????? ?? ????????????????? ??????????? ? ???, ??? ? ?? ???-??????? ????? ???????? ?????? ??? ?????????? ??????????? ?????- ???? ?????? ???????????, ???????? ???????? ? ????????? ???????????? ??????- ???, ??? ???????? ??????????, ???????? ? ????????? ?????? ? ?????????? ?? ??- ??????? ?? ???-???????? ? ?. ?. ? ???? ??????????? ??????????? ??? ???????? ???-???????, ??????? ????????? ????????? ?? ???? ????????????? ???????????, ????? ??? HTTP, HTML, CSS, JavaScript, AJAX ? ?. ?. ????????? ?????? ?????????? ??????????, ??????? ? ???????? ??????? ???-???????? ?? Arduino ? ?????????? ?????????? (?? ??? ???- ?? ????????? ????????? ??? ????????? ???????????). ????? 1. ?????? ?????? ???????????? ????????????, ??????????? ??? ?????? ? ???? ????????????: ?????????? Arduino, ???????? Arduino Uno Shield ??????? ????? ???????? ?????????? Arduino Ethernet ??????? Ethernet ?????? ??? ??????????? ?
? USB ?????? ??? ??????? ? ???????????????? ??????????? Arduino ? microSD ????? ??????, ????????, ???????? 2 ?? (????????? ?????? ??? ????- ????? ??????) ? ????????? ?? ?????? ??? microSD ????? (????????? ?????? ??? ???????? ? SD ???????) ??????????? ????? ?????????????? ??????????, ???????? ????????????? ? ???- ??? ?????, ????? ??? ??????????, ?????????, ?????? ? ?. ?. , ? ????? ???????? ????? ? ????? ???????? ??? ?????????? ???????????. ????????? ??????? ????? ??????? ?????? ????? ????????? ? ????? ????????????????? ????? ?????- ?? (????? ??????????????, ??? ?? ????????? ?????????? ???????? ?????? ? Arduino): 1. ?????????? Ethernet Shield ? ??????????? Arduino ? ????????? ? ??? ??????- ??????????? ??? ?????? ??????????? ????????. 2. ????? ?? ??????? ????????????? ?????? microSD ????? ?????? ? ??????? ????? ???????. ????? 2. ??????? ??????? ???-??????? ARDUINO ??? ????? ??????? ??????? ???-???????, ??????? ? ??????? Arduino Ethernet Shield ????????. ??????????? (???????? ? ????? ?? ?????? ????????????) ???? ???- ???????? SD ????? ? ???? ??????? ?? ????????????, ??? ??? ??? ???-???????? Arduino. ??????????????? ? ?????? ?????? ? ????????? ???-???????? ? ?????? Arduino ????????? ????? ????????? ??????????? Arduino ? Ethernet Shield ?????????? ??????? ? ????? ?? ?????? ???? ???-????????, ????? ???????????? ? ???????? ????????????. /* ?????: eth_websrv_page ?????? ???-??????? Arduino ?? ?????????, ?????????? ? ????? ????????: ??????? ? Arduino ?????? (SD ????? ?? ????????????) ????????????: Arduino Uno Ethernet Shield
??????????? ???????????: ????? ?????????? Arduino IDE Mellis and modified ??????: Webserver example by David A. by Tom Igoe, Ethernet library documentation: http://arduino.cc/en/Reference/Ethernet ???? ????????: 7 ?????? 2013 ?????: W. A. Smith *z #include <SPI.h> #include <Ethernet.h> // MAC-????? ??????? ????? OxBE, OxEF, OxFE, OxED }; ?? ?????????? byte mac[] // IP-????? (????? = { OxDE, OxAD, // ????) ???????? IPAddress ip(10, 0, 0, 20); // ??? ????? ??????? ?????? EthernetServer server(80); ?? 80 ????? void setup() { Ethernet.begin(mac, ip); // ?????????????? Ethernet server.begin(); // ???????? ??????? ??????? ?? ??????? } void loop() { EthernetClient client = server.available(); // (???? ????) «????????» ??????? if (client) { // ???? ??????? boolean currentLinelsBlank = true; while (client.connected()) { if (client.available()) { // ?????? ?? ??????? ???????? ??? ?????? char ? = client.read(); // ?????? 1 ????? (???????) ?? ??????? // ????????? ?????? ?? ??????? ??????? ?????? ? ????????????? ?? ?\\ // ???????? ??????? ?????? ????? ????????? ??????? if (? == fn\\ f && currentLinelsBlank) { // ???????? ??????????? ????????? ?????? client.println \"HTTP/1.1 client.println 200 OK\"); \"Content-Type: text/html\") client.println \"Connection: close\"); client.println ); //???????? ???? ???-???????? client.println \"<!DOCTYPE html>\"); client.println \"<html>\"); client.println \"<head>\"); client.println \"<title>Arduino Web Page</title>\"); client.println \"</head>\"); client.println \"<body>\"); from Arduino!</hl>\"); client.println \"<hl>Hello client.println \"<p>A web page from the Arduino server</p>\"); client.println client.println \"</body>\"); \"</html>\"); break; } // ?????? ?????? ??????, ???????? ?? ???????, ???????????? ?? \\?\\? if (? == '\\?') { // ????????? ?????? ? ?????? ????????? ?????? // ???????? ?????????? ????? ?????? ?? ???????????? ??????? currentLinelsBlank = true; } else if (? != fr\\ f) { // ?? ??????? ??????? ????????? ?????? currentLinelsBlank = false;
} } // end if (client.available()) } // end while (client.connected()) delay(1); // ???? ????? ???????? ??? ?????? ????? ?????? client.stop(); // ????????? ?????????? } // end if (client) } ?????? ?????????! ???? ???????????????????? SD ????? ????????? ? ?????????? ????? Ethernet Shield, ?? ??? ????? ??????? ???????? ? ?????? Ethernet ?????- ?????. ?????? ??? ???????? ??????????? ??? ????????? ??? ?????????? ???????? ??? ??? Ethernet ???????. ??????? ? ???, ??? ? SD ????? ???????? ?? ????? ??- ?? SPI ? ??????? ????????? ??????????? ????? ????????? ?????????? ?????? ??- ?????? ??????????. ???? SD ????? ?? ???????????? ? ????? ??????, ?? ??? ????? ??? ??????? ?? ???, ?? ???????, ??? ???????? ? ????? ????????? ????? ????????? SD ????? ???- ??????? : void setup() { // ????????? SD ?????, ????????? ??????? ??????? ?? 4 ???? pinMode(4, OUTPUT); digitalWrite(4, HIGH); // ?????? ??? ?????????????... } ????????????? ?????? ?????????? ??????????? ???? ??? ? ???????? ??? ? ????? ????? Arduino IDE. ?? ?????? ???????? MAC-?????, ????????? ? ?????? (?? ?????? ??? ?? ?????????- ??) . ???? ????????? ? ?????? IP-????? (10.0.0.20) ?? ????????????? ????? ???- ???? , ?? ??? ????? ???????? ??????????????? ???????1. I - Arduino Web Page - Mozilla Firefox - ?*? v I View History Bookmarks Tools File Edit Help | ['.} Arduino Web Page |+ j I\" ? ? I (0v >:: QJ A r> 10.0.0.20 Hello from Arduino! A web page from the Arduino server ? ????? ??????? ???? ???????????? ?????? ???? ????????? ? ?????????, ??? 1-? ????? ? ??- ??????? ? ????? ???????????. ????????? ????? ? ????? Arduino, 1 ????? ?????, ????????? ? ?????? IP-????? 10.0.0.20 ????? ?????? ????? ????????? ????? ? 192.168.1.20, ??? «192.168.1» — ??? ????? ??????? (?????? ???? ??? ? ? , ? «20» ??? ??????? ?????? ??????????? ? ????????? ????) — ??? ????? ?????? ??????????? Arduino ? ????????? ???? (?? ?????? ???? ????? ???????? ????????????).
??? ???????? ??????? ?? ??????????, ???????????? ? ??? ?? ????, ??? ? ??? ??????????. IP-????? ??????????? Arduino (10.0.0.20 ??? ??? ??????????) ? ???? ??????? ??????????. ??????? ?????????? ???- URL-?????? ???????? ?? ????? ?????? ???????? , ??? ???????? ????. ??????? ??????? ???????????? ???? ??? ?? ??????? ???????????? ? ?????? Arduino ???-???????, ?? ????????- ???, Reset ?? ????????????? ????? ?????? ?? ????? Ethernet Shield, ? ????? ??????? ????? ????????? ???????????. IP-????? ? ???????? ??????? ?????????, ??? ?? ?????????? ?????????? IP-????? ??????????? Arduino. ???- ??? ??? ????? IP-?????? ?????? ??????????????? ???? ????? ????. ????????? ????? ?????????? ?????? ???? ??????????, ?? ???? ??? ?????? ???????????? ? ??- ?? ? ????? ???????. ???? ? ????? ??????? ???? ???????? ???????? ? ??????? ????????????, ?? ?????????? ??????? ? ?????? IP-????? ???????? ????? (???????) ? ????? ???????. ??? ????? ????? ??- ?????? ?????? ? ??????????? ???? ????, ????? ??? ??????????????? ????? ????. ???????? ????? ????????? ? ?????? ??? MAC-???????: // IP-????? ????? byte gateway[] = { 10, 0, 0, 1 }; 255, 0, 0 }; // ????? ??????? byte subnet[] = { 255, ? ????? ???????? ? ??????? setup() ?????? ????????????? Ethernet ? ?????? ???????????: Ethernet.begin(mac, ip, gateway, subnet); Ethernet ?????? ??? ??????????? ? ???? ??????????? Arduino ????? ?????? ??? ??????????, ??- ? «??????» ????????, ? ?? ? ?????????- ????????? Ethernet ?????? ??????????? ???. ??? ???????? ???-?????? ???????????? ? ????????????? ? ??????????????? ??????, ????? ??????, ??? ?????? ????????? ?????? ????. ??? ??????? ??? ?????? ??? ???????? ???-??????, ????????? ?????? ??? ?? ??????? ? ??? ????????? ? ???????? ?? ??? ?? ????. ?????? ??????? ????? ?? ??????????? ? ??????? Arduino ?? ???????? ?????? ????????, ??, ??- ?????????? ?????? ? ???? ???????, ?? ?????? ??????, ???????? ?????: GET / HTTP/l.lr\\ n\\ Host: 10.0.0.20\\r\\n
User-Agent: Mozilla/5.0 (Xll; Ubuntu; Linux ±686; rv:17.0) Gecko/20100101 Firefox/17.0\\rn\\ Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\\r\\n Accept-Language: en-ZA,en-GB;q=0.8,en-US;q=0.5,en;q=0.3r\\ n\\ Accept-Encoding: gzip, deflater\\ \\n Connection: keep-alive\\r\\n \\rn\\ ?????????? ?????????? ??????? ????? ?????????? ? ??????????? ?? ???????? ? ???????????? ???????, ?? ??????? ?? ????????????. ??????? \\??\\ , ??????? ?? ?????? ? ????? ?????? ?????? ?????? ? ???????, ??- ?????? ?????????? (?????????????). \\? — ??? ?????? ???????? ???????, ? \\? — ?????? ????? ??????. ????????? ??????? ??????? ???????????? ????????? ?????? ?????? ? ????????? ?\\ \\? (??? ??????????????? ??????). ????????? ? ??????? ????? ?????? ???????- ???? ????? ?????? ?????? ?, ????? ?? ?????????, ???-?????? ????????? ???? ????????? ??????? ? ???????? ???????? ?????? ???????. ??????? ???????, ??? ?????? ????????? ?????? ?????? ?? ??????? ? ?????????? ????????? ??? ?????????, ????? ??????? ?????? ?????? ? \\?\\?. ????? ??????? ????? ????????? ??????? ???-???????? ?? ???????, ?????? ??????? ?????????? ??????????? ??????????????) (???????????? HTTP-?????, ? ????? ???? ????? ???- ???????? . ???????? Arduino, ???????? ???: ?????, ???????????? ????/1.1 200 ???\\ \\? Content-Type: text/html\\rn\\ Connection: close\\rn\\ \\r\\n ? ??????????? ???? ?????? ????? ???????? ????????? ??????? ?\\ \\?. ??????? println() ? ?????? ????????????? ????????? ??????? ?\\ ?\\ ? ????? ?????? ????- ??. ?????? ??????? println() ? ????? HTTP-?????? ?????? ?????????? ???? ???- ????? ?\\ \\? ??? ?????? ????? ????. ?????? ??????????? ???? ??????? ??????? ? ?????? ???-??????? ???????????? ?????????? ????????? HTTP (Hypertext Transfer Protocol). ???-???????? ????? ????, ??? ?????? ???????? HTTP-????? ???????, ?? ???????? ???????? ???? ????? ??????????? ???-????????, ??????? ????? ???????????? ? ????????. ? HTML-??????. ???-???????? ??????? ?? ?????? ???? ???? ?? ???????????? ? ????????, ????????? ????????????? ?????? ??? ???????? ?????? ? ????????????? ?? ?????????. ????? ??????? ???????? HTML ???, ? ???????? ???????? ?????? ??????? ???? ?? ???-???????? ? ???????? ????? ???????????? ???? «??????????? ???????? ??? ????????». ??? ?????????????? ????? ???????? ???????? ? ?? HTML-???????? ????? ?????? ??????? ?? ????????? ????. ? ?? ?????????????? ?????????? ??????? ???? (??????) ???-?????? ?? Arduino ? ???????? ???????????? ???????????? ?? ??????? ?? ???? ??????. ????????????? ? ?? ???? ?????? ? ????????? ??????????? ??? ??? ????????? ???????? ????????? ?????? ?????????.
- Source of: http://10.0.0.20/ - Mozilla - File Edit View Help <! DOC TYPE htn:l> Web Page</title> server</p> <html> from Arduino!</h1> page from the Arduino <head> <title>Arduino </head> <body> <h1>Hello <p>A web </body> </html> ????? ?. ????????? ???-???????? (HTML) ???-??????? Arduino ? ???? ??????????? ???????????? ??? ???????????? ???- ??????? HTML, ??????? ?? ?????? ????? ????? ????? ?????? ?????? ? HTML, ??? ? ??????????????? ? ???? ????? ???????????. ??????? ????????? HTML-???????? ???????? ???? (???? ??? ???? ?? ??????????? ?????). <!DOCTYPE html> <html> <head> <title>Arduino Web Page</title> </head> Arduino!</hl> <body> from from the Arduino page <hl>Hello <p>A web server</p> </body> </html> HTML-???? ??? HTML-???????? ??????? ?? ?????, ??????????? ? ??????? ??????: <> ??? html-???? ?????????? ????? ??????????? ? ??????????? ???????? ????????. ??????????? ????? ????? ????? ??????????? ? ??????????? ???. ????? ??? ??- ????, ?????????? ????? ??????????? ? ??????????? ??????? ?????, ????? ?????- ????????? ????????? ? ???????????? ? ????? ????. ??????????? ??? ????? ????? ??, ??? ???????????, ?? ??????????? ????, ??? ??????????? ??? ????? ????? ????? ????? ??????????? ??????? ??????. ????????: <?>????? ??????...</?> — ????? ??? ?????? (<?>) ????????????, ????? ????- ???? ????????, ??? ????? ????? ??????????? <?> ? ??????????? </?> ???????? ??????? ??????. ??????? ????????????? ??? ??????????????? ???????. ???????? ????, ?? ???????? ???????????? ????, ???????? ?????? ??????, ????- ??? ?????????? ?? ????????? ?????? ???-????????. ??? ???????????? ??? <??> (? ?? ?????????? ??? <?? /> ?? ?????????? ???????????? HTML) (? ???????????? XHTML) . ???????? HTML ??????????? ? ???????? ????? HTML: ????? ???? ????????, ???
??? ?????? ? ????? ???? ????? ????????? ????? ?????? ??????? ??????. ????????? ???-???????? ???-???????? ??????? ?? ???? ???????? ???????? — ??????? ????????? ? ?????- ?? ????. ??? ??? ??????? ??????????? ????? ??????????? ? ??????????? HTML- ?????? , ??? ???????? ?????: <html> <head> </head> <body> </body> </html> ???????, ??????? ?????? ???? ????? ?? ???-???????? ??? ??????????? ? ?????- ?????? ???-????????, ?????????? ????? ?????? body. ???????, ??????? ?? ???????????? ?? ????????, ?????????? ????? ?????? ????- ?????? ??- ?????, ????????, ????? ????????? ????????, ???????????? ?? ??????? ??????? ???- ?? ???-????????. ????? ???? ????? ???? ???????? ????? ?????, ??? ???. ???????? ???? HTML ?? ??? ?????? HTML-??? ?????? — <?> ? ????????? ????, ?? ??????? ??????? <html>, ??? ??????? HTML-???????? — <head> ? <body>. ???? ????????? ??? HTML- ???? , ??????? ?????????????? ? ?????? ??????? ??????? Arduino. ????????- ?????????????? ????????? ??????????? ???? ????? ? ???? ?? ???? ?? ????? . ??? ????????? ???? ?????????? ??????? ????? ?????????, ??????? ?????? ?????????? ??????- ??? ?????????? ??????? ? ??????, ??? ????? ??????. ? ????? ?????? ??????? Arduino ????????????? ??? ????????? 1 — <?>. ??? ????????? ???????? ?????? ? ? ??????????????? ??????????? ?????. ???? ?????, ????????????? ????? <?> ? </?>, ?????????? ??? ????????? 1-?? ??????. ? ?. ????? ???????????? ?????? ?????? ?????? hi ? ???????????? ??? h2, h3, h4 ?. ?. (<h2>, <h3>, <h4> ? ?. ?.) ???????? ????????? hi ????????????, ????????, ??? ??????????? ????????? ?????. ????? 1, h2 ???????? ????????????, ????????. ????????? 1.1, 1.2, 2.1 ?. ?., h3 ?????????? ???????????? ????????? h2, ????????. 1.1.1 ? 1.1.2 ? ?. ?????? ?????????????? ??????? ????????? ????? ???????????? ????????? ? ???? ????? ??????? ??????. ??? ???????? ??? ???????? <title> ??????????? ? ??????? <head> HTML-???????? ? ????????- ???? ??? ??????????? ?? ????? ? ??????? ?????? ???-????????. ??? ???????????? ????????? ???-????????. ?????? ???-???????
????? ??????? ???-???????, ????????? ? ??????????? ??????????? Arduino (??- ??????? -> «Examples» -> «Ethernet» ? ??????? «File» ?????? -> «Webserver» — ? ??? ?????? ?? ????????????? ????, ?? ????? ???? ????????? HTML-????????, ? ?????? ????? ????????? ????? ???????? ????? ??????????? ? ??????????? ?????? <html>. ? ??????? Webserver ?????? ?????? ????????????? ???????? ??????, ??? ??? ????????? ?????? ???????????? ? ???????? ??? ?????????? ???????. ?? ????????? ??????????? ???????????? ???????? ???????? ?????? ?????? Webserver ? ???????? ? HTML-???, ??? ???????? ????????? ??????. 1 v> 10.0.0.20 ? Source of: http://10.0.0.20/ - Mozill - xv File Edit View Help analog input 0 is 1023 analog input 1 is 1023 < 'DOC! P\\ E HT\\'L> analog input 2 is 695 analog input 3 is 564 <html> http-equiv^refresh\" 1023<br content^S'^ analog input 4 is 406 input 0 is 1023<br /> analog input 5 is 340 <meta input 1 is 691<br /> input 2 is 561<br /> analog input 3 is 405<br /> analog 331<br /> analog input 4 is /> analog input 5 is analog analog </html> ? ???????? HTML ???? HTML ????? ???????????? ? ???? ??????????? ?? ???? ?????????????, ?? ? ?????????, ???? ?? ?????? ?????? ?????? ? HTML, ???? ????????? ????? ???? ???????? ????? ?? HTML. ????? 4. ???-?????? ?? ARDUINO ? SD ?????? Arduino, Arduino Ethernet Shield ? ????? micro SD ???????????? ??? ???????? ???-???????, ?? ??????? ??????????? ???-???????? ?? SD-?????. ????? ??????? ??????????? ???????? ???-???????? ? ???-??????? Arduino, Arduino ????????? ???- ? SD-?????. ???????? ???-???????? ????????? ???-???????? ?????? ????????? ?? SD-?????, ?? ?????????? ??????? ??????? ? ??????? ?????????? ?????????, ? ????? ??????????? ?? SD-?????. ????? ???????????? ????????, ????????? ????? ??? Geany2 — ?? ???????? ??? ???????? ? Windows ???????????? Ubuntu. ? ????? ? ??? ??????????? ????????????? Linux ?? ?????? ????????? Geany ????? ?????????? ? ????????????? ????????? ????? ???? HTML, ??? ???????? ?????????????? ???-????????. ????? ???????????? 2 https://www.geany.org/
?????? ????????? ????????, ???? ??????? Windows. ???????? ? ????????? ???????? ????????? ???-???????? ? ????????? ?????????. ????? ?? ????????? ????????? ????, ????? ??? ???: index.htm <!DOCTYPE html> <html> <head> <title>Arduino SD Card Web Page</title> </head> <body> from the Arduino SD Card!</hl> page from <hl>Hello <p>A web the Arduino SD card server.</p> </body> </html> ????? ??? ?????? ??????, ??? ?? ?? ?????, ??? ? ???-???????? ? ??????? ???- ??????? ? ???? ???????????, ?????? ? ?????????? ???????. ????????????? ??? ???-????????, ?????? ?? ? ???-????????. ??????????? ???-???????? ??? ??????????? ???? ??? ????? micro SD ?? ????? ?????????? ??? ?????????? ?????? ????, ????????? ?????? ? ?????????? ????? micro SD. ???????? ????? micro SD ? ???? ?? ?????????? ??? ????-?????, ???????????? ? ??????????, ? ?????????? ???? index.htm ?? ????? micro SD. ?????? ???????? SD-????? ? ???? ??? ????? micro SD ?? ????? Ethernet Shield. ???-?????? ?? SD-????? ?????? ? ??? ?????? ???? ????? micro SD ? ????????????? ?? ??? ???- ?????????, ??????????? ? ???? ??? ????? ?? ????? Arduino Ethernet. Ethernet Shield ?????? ???? ????????? ? ???????????? Arduino ? ?????? Ethernet Shield ????????? ????? ? ????? ????. Arduino/Ethernet ?????? ???????? ?? USB-??????. ???????, Arduino, ??????? ????????? ???-???????? ? SD-????? ? ?????????? ?? ? ??????? ????. /* eth_websrv_SD Program: Description: Arduino web server that serves up a basic web Hardware: page. The web page is stored on the SD card. Arduino Software: Uno and official Arduino Ethernet References: shield. Should work with other Arduinos and compatible Ethernet shields. FAT16 SD card formatted 2Gb micro Developed using Arduino 1.0.3 software Should be compatible with Arduino 1.0 + SD card contains web page called index.htm - Webserver example by David A. Mellis and modified by Tom Igoe
- SD card examples by David A. Mellis and Tom Igoe - Ethernet library documentation: http://arduino.cc/en/Reference/Ethernet - SD Card library documentation: http://arduino.cc/en/Reference/SD Date: 10 January 2013 Author: W.A. Smith */ #include <SPI.h> #include <Ethernet.h> #include <SD.h> // MAC address from Ethernet shield sticker under board byte mac[] ={ OxDE, OxAD, OxBE, OxEF, OxFE, OxED }; 0, 0, 20); // IPAddress ip(10, // IP address, may need to change depending on network server(80); EthernetServer create a server at port 80 File webFile; void setup() ip); // initialize Ethernet device { // start to listen for clients Ethernet.begin(mac, server.begin(); // for debugging Serial.begin(9600); // initialize SD card Serial.println(\"Initializing SD card...\"); if (!SD.begin(4)) { Serial.println(\"ERROR - SD card initialization failed!\"); file!\"); return; // init failed } Serial.println(\"SUCCESS - SD card initialized.\"); // check for index.htm file if (!SD.exists(\"index.htm\")) { Serial.println(\"ERROR - Can't find index.htm return; // can't find index file } Serial.println(\"SUCCESS - Found index.htm file.\"); } void loop() { EthernetClient client = server.available(); // try to get client if (client) { // got client? boolean currentLinelsBlank = true; while (client.connected()) { if (client.available()) { // client data available to read char ? = client.read(); // read 1 byte (character) from client // last line of client request is blank and ends with n\\ // respond to client only after last line received if (c == '\\n' && currentLinelsBlank) { // send a standard http response header client.println(\"HTTP/1.1 200 OK\"); client.println(\"Content-Type: text/html\"); client.println(\"Connection: close\"); client.println();
// send web page webFile = SD.open(\"index.htm\"); // open web page file if (webFile) { while(webFile.available()) { client.write(webFile.read()); // send web page to client } webFile.close(); } break; } // every line of text received from the client ends with \\r\\n if (c == -\\n') { // last character on line of received text // starting new line with next character read currentLinelsBlank = true; } else if (c != '\\r') { // a text character was received from client currentLinelsBlank = false; } } // end if (client.available()) } // end while (client.connected()) delay(1); // give the web browser time to receive the data client.stop(); // close the connection } // end if (client) } ???? ????? ???????????? ????? ???????????????? ?????? ?????? eth_websrv_page ?? ????? 2 ????? ???????????. ?????? ????? ?????????????? SD-????? ? ??????? setup() ? ?????????? ??????- ????????? ?????????? ????? ???????????????? ????, ??????? ????? ??????????? ? ???? ????????????????? ???????? Arduino. ?????? ???????? ???-???????? ????????? ?? ????, ??? ? ?????? eth_websrv_page, ???? ????? ????? ?????? ????????? ???? index.htm ? SD-????? ? ?????????? ?????????? ???-??????? (???-????????). ????????????? ?????? ?????????? ??????????? ???? ????? ? ???????? ??? ? Arduino IDE. ????????? ??????, ????? ? Arduino, ? ????? ????????? ? IP-??????, ?????????? ? ? ????- ? ??? ???-????????. ????????? ???? ???-???????? ?????? ???????????? ????????, ????????????? ????????? ??? ???-???????? SD-????? Arduino. ????? ?????? ???? ?????????? ????? ? ???? ??????????? ????????, ?? ????????????, ??? ??- ??? ????? ?? ???, — ??? ????????????? SD-????? ? ????? ?? ??? ????? index.htm. ???? ????? ??? ?? ????? ??? ?? ?? ????? ??????? ???????? index.htm, ?? ?????? ?? ?????? ?????????? ???-????????. ???????? ???? ????????????????? ???????? Arduino, ????? ??????????? ??????- ????????? ?????????? ? SD-?????.
????? 5. ?????????? ARDUINO ???????????? ???-??????? ? ???? ????? ??????????? ????? Arduino ? Ethernet ??????????? ???-????????, ??????? ????????? ???????? ? ????????? ?????????3. ????????? ???????????? ? ?????? ?? ????????? Arduino — ??? ??????? ????? ????? ??????? ?? ???????? ?????. ????????? ????????? ? Arduino, ??? ???????? ?? ?????????????? ????? ? ????- ??????? «?????? ?????? ? Arduino»4. ??? ?????? ????????? ? ???????????????? ? GND. ???????? ? ???????????? ????? ????????? 2 Arduino SD-????? ?? ???????????? ?? ???? ???-???????. ?????????? ??????????? ???????? ?? ??????????? ????. ??? ??????????? ????????? ???-?????? Arduino ??????????? ????????, ??????? ????????? ???????????? ?????????. ??????- ???????? ??????, ????? ???????? ??? ????????? ???-???????? ?? ?????: ? I ?> 10.0.0.20 LED Click to switch LED on and off. ^LED2 3 https://www.youtube.com/watch?v=RULB8FfNxKU 4 https://startingelectronics.org/beginners/start-electronics-now/tut3-starting- with-arduino/
HTML-???, ??????? ???-?????? Arduino ?????????? ? ???-???????, ??????? ??- ?? . 1 <!D0CTYPE html> 2 B<html> 3? <head> 4 <title>Arduino LED Control</title> 5 </head> 6 ?3 <body> 7 <h1>LED</h1> 8 <p>Click to switch LED on and off.</p> 9 ?p <form method= > 10 <input type= name= value= onclick >LED2 11 </form> 12 </body> 13 L</html> ????? ????????? ?????? ??? ????????? ?????????? ???-???????? ? HTML-??? ??- ???? ???????? ????????? ???????: ?' 10.0.0.20 ? :i- = ~-: LED Click to switch LED on and off. ? LED2 ???????? ???????? ?? ??????????? ????, ??? ???-??????? ??????? /?LED2=2 ? ????? ???? URL-?????? ????? ????, ??? ?????? ??? ??????????. 1 <!D0CTYPE htr.l> 2 ? D<html> <head> 3] 4 <title>Arduino LEO Control</title> 5 </head> 6 ?J <body> 7 <h1>LED</h1> 8 <p>Click to switch LED on and off.</p> 9 ?J <form rethod= > 10 <input type= nane= value= onclick= checke<^>LED2 11 </form> 12 </body> 13 L</html> ?? ??????????? ???? ??????????? Arduino ??????? HTML-????????, ??????? ?? ????????? ???????? ? ???????, ??? ??? ?????? ????? ???????????? ? ????????. ???????? ???? ???????? ?? ???????????, ? ?????, ??? ??????. ????? HTML-???? ? ??????????? ???? HTML-???? ???????????? ??? ????? HTML-????, ? ?????? <form> ? <input>.
HTML-??? <form> ??? ????? ???????? ???????? ?????????? ?????, ????? ??? ??????, ?????????- ??? ? ???? ???????. ? ???? ????? method=\"get\" ? ??????????? ???? ????? ?????- ??? ? ???????? ????? ? ?????????????? HTTP-??????? GET. ??? ????? ???????? ? URL ???-????????. ?????????? ??????5 /?LED2=2 ? ???? HTML-??? <input> ???? ??????? ?????????? ??????????? ? HTML-????? ? ??????? ???? <input>. ??????? ??? ?? ????? ???????????????? ???????????? ????. ??????. ? ???? ??????? ??? input ???????????? ??? ???????? ? ??? ????? ???????? ????????? ????: ? type=\"checkbox\" — ?????????? ???? ??????? ?????????? ?????? ? ???? ?????? ? name=\"LED2\" - ???????????? ????????????? ??? ???????? ?????????? ? value=\"2\" - ???????????????? ???????? ???????? ?????????? ? onclick=\"submit();\" - ????????? ?????, ????? ??????? ??????? ?????????? ??????? ? checked — ???? ????????????, ?????? ??????????, ? ????????? ?????? ?? ????. HTTP-?????? ? ????? ????? ?????? ??????????, ?? ?????????? HTTP-?????? GET, ??????? ?????????? ?? ???????? ??? ? ???????? ?? ?????? ?? ?????? Arduino. ???? ???????? ?????? HTTP-???????, ????????????? Firefox ?? ?????? Arduino ????? ????????? ??????: GET /?LED2=2 HTTP/1.1 Host: 10.0.0.20 User-Agent: Mozilla/5.0 (Xll; Ubuntu; Linux ±686; rv:18.0) Gecko/20100101 Firefox/18.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-ZA,en-GB;q=0.8,en-US;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Referer: http://10.0.0.20/ Connection: keep-alive ??? ??????????????? ?????? ????????? HTTP-?????? ???????????? ?? ???????? ?? ???-?????? Arduino: GET / HTTP/1.1 Host: 10.0.0.20 User-Agent: Mozilla/5.0 (Xll; Ubuntu; Linux ±686; rv:18.0) Gecko/20100101 Firefox/18.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-ZA,en-GB;q=0.8,en-US;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Referer: http://10.0.0.20/?LED2=2 Connection: keep-alive ????? Arduino ? ???? ??????? ????????? ????????? HTTP-??????? ? ????????? ????? LED2 = 2, ?, ???? ??????????, Arduino ????? ??????????? ????????? ? ??- ?????????? ?? ???????????. 5 ???? ???????? name=\"LED2\" ????????? ???????? value=\"2\". ??
??? ??????????? ???? ???????? ???????? ????? LED2 = 2, ???? ? ?????? ???- ??? . ??? ????????????? ?????? ????? ???????? ?????? ?????? ??????? GET. ??? ?? ????????????? ?????? ????? ???????? ?????? Referer: ?????????. ? ??????? ???? ?????????? ?????????? ?? ?????? ????? ???????, ??? ???????? ????? Arduino. ????? Arduino ??? ????????????? ???-??????? ??????? ????. /* e th_web s rv_LED Program Descript ion Arduino web server that serves up a web page Hardware: allowing the user to control an LED Software: - Arduino Uno and official Arduino Ethernet References: shield. Should work with other Arduinos and Date: Author: compatible Ethernet shields. - LED and resistor in series connected between Arduino pin 2 and GND Developed using Arduino 1.0.3 software Should be compatible with Arduino 1.0 + - Webserver example by David A. Mellis and modified by Tom Igoe - Ethernet library documentation: http://arduino.cc/en/Reference/Ethernet 11 January 2013 W.A. Smith #include <SPI.h> #include <Ethernet.h> // MAC address from Ethernet shield sticker under board byte mac[] ={ OxDE, OxAD, OxBE, OxEF, OxFE, OxED }; 0, 0, 20); // IPAddress ip(10, // IP address, may need to change depending on network server(80); EthernetServer create a server at port 80 String HTTP_req; = 0; // stores the HTTP request // state of LED, off by default boolean LED status void setup() { Ethernet.begin(mac, ip) // initialize Ethernet device clients server.begin(); // start to listen for Serial.begin(9600); // for diagnostics pinMode(2, OUTPUT); // LED on pin 2 } void loop() client = server.available(); // try to get client { EthernetClient if (client) { // got client? boolean currentLinelsBlank = true; while (client.connected()) { if (client.available()) { // client data available to read char ? = client.read(); // read 1 byte (character) from client HTTP_req += c; // save the HTTP request 1 char at a time // last of and ends line client request is blank with \\n // respond to client only after last line received if (c == '\\n' && currentLinelsBlank) {
// send a standard http response header client.println(\"HTTP/1.1 200 OK\"); client.println(\"Content-Type: text/html\"); client.println(\"Connection: close\"); client.println(); // send web page client.println(\"<!DOCTYPE html>\"); client.println(\"<html>\"); client.println(\"<head>\"); client.println(\"<title>Arduino LED Control</title>\"); client.println(\"</head>\"); client.println(\"<body>\"); client.println(\"<hl>LED</hl>\"); client.println(\"<p>Click to switch LED on and off.</p>\"); client.println(\"<form method=\\\"get\\\">\"); ProcessCheckbox(client); client.println(\"</form>\") client.println(\"</body>\") client.println(\"</html>\") Serial.print(HTTP_req); HTTP_req = \"\"; // finished with request, empty string break; } // every line of text received from the client ends with \\rn\\ if (c == '\\n') { // last character on line of received text // starting new line with next character read currentLinelsBlank = true; } else if (c != '\\r') { // a text character was received from client currentLinelsBlank = false; } } // end if (client.available()) } // end while (client.connected()) delay(1); // give the web browser time to receive the data client.stop(); // close the connection } // end if (client) } // switch LED and send back HTML for LED checkbox void ProcessCheckbox(EthernetClient cl) { if (HTTP_req.indexOf(\"LED2=2\") > -1) { // see if checkbox was clicked // the checkbox was clicked, toggle the LED if (LED_status) { LED_status = 0; } else { LED_status = 1; } } if (LED_status) { // switch LED on digitalWrite(2, HIGH); // checkbox is checked cl.println(\"<input onclick=\\\"submit();\"\\ type=\\\"checkbox\"\\ name=\"\\ LED2\\\" value=\"\\ 2\"\\ \\ checked>LED2\");
else { // switch LED off digitalWrite(2, LOW); // checkbox is unchecked cl.println(\"<input type=f\\ fcheckbox\\ff name=\\ffLED2\\ff value=f\\ f2f\\ f \\ onclick=\\\"submit();\"\\ >LED2\"); } } ???? ????? ???????????? ????? ???????????????? ?????? ?????? ETH_WEBSRV_PAGE ? ???????? ???-??????? Arduino. ???????? ????? ??????? HTML, ??? ??????, ?? ???????? ??????? ProcessCheckbox (), ????? ????????? ??????, ??????? ?????? ??????. ??????? ProcessCheckbox () ?????????, ???????? ?? HTTP-?????? ????? LED2 = 2. ???? HTTP-?????? ???????? ???? ?????, ?? ????????? ????? ?????????? (????- ?????? ? ON ?? OFF ??? ? OFF ?? ON), ? ???-???????? ????? ???????????? ? ???- ?????? ??????, ????? ?????????????, ????? ???????? ????????? ??????????. ????? ??? ??????? ??? ??????? ?????, ?? ????????? ????????? ????? ???? ???- ????, ????? ??????? ??? ????? ????????. ????? ? ????????? ????? ????????? ?????? ??????? ?????????? ?????????? LED2 = 2 ? HTTP-???????, ????? ???????, ??? ?? ????? ??????. ???? ?? ????? ??????? ?????????, ??? ????? LED2 = 2 ????????? ? ????????? HTTP, ????? ??????????, ?????????? ?? ?????? ??? ???. ??? ??????? ?? ???????????, ????? ????????? ?????????? ? ????????? ?????? ????? ?????????????????????. ????? 6. ?????? ????????? ?????? ? ?????????????? ???-??????? ARDUINO ????????? ??????, ??????????? ? Arduino, ????????, ????? ??????? , ???????? ??? ??? ?????????. ????????? ????????????? ???????????? ?? ???-????????. Arduino ? Ethernet Shield ???????? ??? ???-?????? ? ???????? ?? ???-????????. ??????? ????????? ???-???????? ?????? ???????, ??????? ?? ????? ?????? ??- ?????, ????? ????? ????????? ????????????? ???????????? ????? ??????? ??? ??- ????? ??????. ? ?????? ?????????? ???????????? ????? ?? ?????? ?? ????????7 Arduino ?? ???-????? Arduino, ?? ??????????? ????, ??? ????????????? ????????? ? ??????- ?? 3, ? ?? ? ???????? 2 ???????. I 6 https://www.youtube.com/watch?v=Nppc4_oHD2A 7 https://www.arduino.cc/en/Tutorial/BuiltlnExamples/Button
9^^^V?^^lBj to-??? 1 1 ?,^^^^??^? ?\"? 11 ^ | 1 ,,:|::|1.1.:::::.:::::.1 =L) ???????? ??? ??? ???-??????? Arduino ??????? ????. Program: e th_web s r v_s wi t ch shows the state of a switch Description: Arduino web server Hardware: on a web page. Does not use the SD card. Software: Arduino Ethernet References: Arduino Uno and official Date: shield. Should work with other Arduinos and Author: compatible Ethernet shields. Developed using Arduino 1.0.3 software Should be compatible with Arduino 1.0 + - Webserver example by David A. Mellis and modified by Tom Igoe - Ethernet library documentation: http://arduino.cc/en/Reference/Ethernet 12 January 2013 W.A. Smith #include <SPI.h> #include <Ethernet.h> // MAC address from Ethernet shield sticker under board byte mac[] ={ OxDE, OxAD, OxBE, OxEF, OxFE, OxED }; 0, 0, 20); // IPAddress ip(10, // IP address, may need to change depending on network server(80); EthernetServer create a server at port 80 void setup() { Ethernet.begin(mac, ip); // initialize Ethernet device clients server.begin(); // start to listen for pinMode(3, INPUT); // input pin for switch } void loop() client = server.available(); // try to get client { EthernetClient
if (client) { // got client? boolean currentLinelsBlank = true; while (client.connected()) { if (client.available()) { // client data available to read char ? = client.read(); // read 1 byte (character) from client // last line of client request is blank and ends with n\\ // respond to client only after last line received if (c == 'n\\ ' && currentLinelsBlank) { // send a standard http response header client.println(\"HTTP/1.1 200 OK\"); client.println(\"Content-Type: text/html\"); client.println(\"Connnection: close\"); client.println(); // send web page client.println(\"<!DOCTYPE html>\"); client.println(\"<html>\"); client.println(\"<head>\"); Read Switch State</title>\"); client.println(\"<title>Arduino client.println(\"<meta http-equiv=\\\"refresh\"\\ content=\"\\ l\"\\ >\"); client.println(\"</head>\"); client.println(\"<body>\"); client.println(\"<hl>Switch</hl>\"); client.println(\"<p>State of switch is:</p>\"); GetSwitchState(client); client.println(\"</body>\"); client.println(\"</html>\"); break; } // every line of text received from the client ends with r\\ \\n if (c == 'n\\ ') { // last character on line of received text // starting new line with next character read currentLinelsBlank = true; } else if (c != '\\r') { // a text character was received from client currentLinelsBlank = false; } } // end if (client.available()) } // end while (client.connected()) delay(1); // give the web browser time to receive the data client.stop(); // close the connection } // end if (client) } void GetSwitchState(EthernetClient cl) { { if (digitalRead(3)) cl.println(\"<p>ON</p>\"); } else { cl.println(\"<p>OFF</p>\"); } } ????? ??, ???? ????? ???????????? ????? ???????????????? ?????? ?????? ? Arduino. ETH_WEBSRV_PAGE ???????? ???-??????? ??????????? ??? ??????? ???-???????? ??? ??????, ?? ????????? ????,
GetSwitchState () ??????????, ????? ????? ???????????? ????? ??? ???????????- ??. ? ??????? GetSwitchState () ????????? ????????????? ????????. ?????, ????- ??? ???????????? ? ???????, ????? HTML-???????, ??????? ???????? ???? «ON», ???? «OFF», ? ??????????? ?? ????????? ?????????????. ?????? HTML ? <head> ????? HTML-????????, ???????????? ? ???????, ????????- ???? ??? ????, ????? ???????? ???????? ????????? ???????? ?????? ???????. ??? ????????? ?????????? ????? ????????? ?????????????, ???? ?? ?????????. ?????? ???? ? ??????, ??????? ?????? ???, ???????? ?????: client.println (\"<meta http-equiv = \"\\ refresh \\ \"content = \"\\ 1 \\ \">\"); ??? ????? ?????????? ? ??????? ? ???????? ?????????? HTML-????: <meta http-equiv = \"refresh\" content = \"1\"> «1» ? ???? ??????? ???????? ????????? ?????? 1 ???????. ???????, ??? ?? ?????? ???????? ?????? ??????? ???? ?? ???-???????? ? ????? ????????, ? ????? ??????? ???????? ????????? ???????? ?? ??????????? ???? (??? ??????????? ??????? ???? ? ??????????? ?? ????????????? ???? ????????). ??? ??? ?? ?????, ??????? ???????????? ??? ?????? ?????????? ?????? Arduino ? ??????? Webserver, ??????? ??????? ? ??????????? ??????????? Arduino (???- ???? ? Arduino IDE ? ??????? File -> Examples -> Ethernet -> Webserver). ????????? ????? ??????? ??????????? ???? ?? ???? ?????? ?????????? ????????, ??????????? ? ???, ??? ??????? ?????? ?????? ???????, ????? ?? ????????? ????????. ? ????????? ????? ????? ???????? ?? ????? ???????????? ?????, ?????????? AJAX, ??????? ????? ????????? ?????? ????? ???-????????, ??????? ?????????? ????????? ?????????- ??. ????? 7. ??????????? ??????? ????????????? ?? ????????? ARDUINO AJAX ???-??????? ? ??????? ????????? ?????????????, ????????????? ? ????? Arduino/Ethernet, ????????- ???? ?? ???-????????, ??????????? ?? Arduino. AJAX ???????????? ??? ????????? ????????? ????????????? ??? ??????? ?????? ?? ???-????????8. ??????? ????????????? ?????? ?? ???-???????? ??? ?????????? ????????? ????- ????????? ??????????? ? ???, ????? ??????? ??? ??????? ??? ???, ??? ????? ?????? ??- ?????? ? AJAX. ????????? ????? ???? ????? ????? ???????????????? ??????? ????????????? ? ??????? AJAX ??? ????? ????????????? ??????????. ????? ?? ?? ??? ?? ????? 6. ??? ????? ????? AJAX ???????? ??????????? JavaScript ? XML. AJAX — ???, ?? ????, ????????????? ?????? ??????? JavaScript ??? ????????? ?????? ?????????? ? ???-??????? (?????? Arduino). ??? ????????, ??? ?? ???- ???????? ????? ???????????, ?? ???????? ?????? ??? ??? ???????? ???????. ????????????? AJAX ????? ?????????? ?? ????????? ? ?????????? ?????? ????? https://www.youtube.com/watch?v=AXG5bdCkSQo
???????????, ????????? ??? ?????????? HTML, ??????? ?????????? ???????? ???- ???? ?????? ???, ????? ??? ???????????????, ??????? ?????? ?? ?????. ?? ???????? ??- ??? ??????????? ?????? ?? ??????????, ?????????? (????????? ???????- ??????) , ??????????? ????????. ??? ????? JavaScript? JavaScript — ??? ???? ????????? ?? ??????? ???????. ??? ????????, ??? ??? ???, ??????? ????? ???????? ? ???-????????. JavaScript ??????? ? HTML-????????. ????? ?? ?????????????? ???-???????? ??????????? HTML, ??????????? ?? Arduino, ???????? ? JavaScript ? ??? ????- (??? ???????, ???. ????? ??? ??????? ????????? ??? JavaScript ??? ?? ?? ??- ??????? JavaScript ? ????? ????????). AJAX-????? ??????? ????? ??? ???? ????? ????? ??????? ????. ?????????? ??? ? ???????? ? Arduino IDE, ? ????? ????????? ? Arduino. h e th_web s rv_AJAX_swi tch Program: shows Description: Arduino web server the state of a switch Hardware: on a web page using AJAX. The state of the Software: References: switch must be read by clicking a button on Date: the web page - for demonstrating AJAX. Author: Does not use the SD card. Arduino Uno and official Arduino Ethernet shield. Should work with other Arduinos and compatible Ethernet shields. Developed using Arduino 1.0.3 software Should be compatible with Arduino 1.0 + - Webserver example by David A. Mellis and modified by Tom Igoe - Ethernet library documentation: http://arduino.cc/en/Reference/Ethernet - Learning PHP, MySQL & JavaScript by O'Reilly publishers Robin Nixon, 15 January 2013 W.A. Smith -*/ #include <SPI.h> #include <Ethernet.h> // MAC address from Ethernet shield sticker under board byte mac[] ={ OxDE, OxAD, OxBE, OxEF, OxFE, OxED }; 0, 0, 20); // IPAddress ip(10, // IP address, may need to change depending on network server(80); EthernetServer create a server at port 80 String HTTP_req; // stores the HTTP request void setup() { Ethernet.begin(mac, ip); // initialize Ethernet device server.begin(); // start to listen for clients
Serial.begin(9600); // for diagnostics pinMode(3, INPUT); // switch is attached to Arduino pin 3 } void loop() { EthernetClient client = server.available(); // try to get client if (client) { // got client? boolean currentLinelsBlank = true; while (client.connected()) { if (client.available()) { // client data available to read char ? = client.read(); // read 1 byte (character) from client HTTP_req += c; // save the HTTP request 1 char at a time // last of and ends line client request is blank with \\n // respond to client only after last line received if (c == '\\n' && currentLinelsBlank) { // send a standard http response header client.println(\"HTTP/1.1 200 OK\"); client.println(\"Content-Type: text/html\"); client.println(\"Connection: keep-alive\"); client.println(); // AJAX request for switch state if (HTTP_req.indexOf(\"ajax_switch\") > -1) { appropriate // read switch state and send paragraph text GetSwitchState(client); } else { // HTTP request for web page // send web page - contains JavaScript with AJAX calls client.println \"<!DOCTYPE html>\"); client.println \"<html>\"); client.println \"<head>\"); client.println \"<title>Arduino Web Page</title>\"); client.println \"<script>\"); client.println \"function GetSwitchState() {\"); client.println \"nocache = \\\"&nocache=\"\\ \\ + Math.random() * 1000000;\"); {\"); client.println \"var request = new XMLHttpRequest();\"); client.println \"request.onreadystatechange = function() client.println \"if (this.readyState == 4) {\"); client.println \"if (this.status == 200) {\"); client.println \"if (this.responseText != null) {\"); client.println \"document.getElementByld(\\\"switch_txt\\\")\\ .innerHTML = this.responseText;\"); client.println \"}}}}\") ; client.println \"request.open(\"\\ GET\\\", \"\\ ajax_switch\\\" + nocache, true);\"); //client.println(\"request.open(\"\\ GET\\\", true);\"); \"\\ ajax_switch\\\", client.println(\"request.send(null);\"); client.println(\"}\") ; client.println(\"</script>\"); client.println(\"</head>\"); client.println(\"<body>\"); client.println(\"<hl>Arduino AJAX Switch Status</hl>\"); client.println( \"<p id=\\\"switch_txt\"\\ >Switch state: Not requested...</p>\"); type=\"\\ button\"\\ \\onclick=\\ client.println(\"<button \"GetSwitchState()\\\">Get Switch State</button>\"); client.println(\"</body>\");
client.println(\"</html>\"); } // display received HTTP request on serial port Serial.print(HTTP_req); HTTP_req = \"\"; // finished with request, empty string break; } // every line of text received from the client ends with r\\ \\n if (c == 'n\\ ') { // last character on line of received text // starting new line with next character read currentLinelsBlank = true; } else if (c != '\\r') { // a text character was received from client currentLinelsBlank = false; } } // end if (client.available()) } // end while (client.connected()) delay(1); // give the web browser time to receive the data client.stop(); // close the connection } // end if (client) } // send the state of the switch to the web browser void GetSwitchState(EthernetClient { cl) { state: if (digitalRead(3)) state: cl.println(\"Switch ON\"); } else { cl.println(\"Switch OFF\"); } } ??????????? ???? ????? ???????? ????????? HTML ? JavaScript (??. ????) ? ???-???????. ????????? ???????? ? ????? <head> HTML-???? ????? ??????????? ? ??????????? ?????? <script> ????? ????? ??????? JavaScript. ?????? ???, ????? ?????????? ?????? ?? ???-????????, ?????????? ??????? JavaScript GetSwitchState(). ????? ?????????? ?????? ???-???????? ? ?????????? ??????? GetSwitchState(), ??? ?????????? ?? Arduino HTTP-?????? GET, ?????????? ????? «ajax_switch». HTTP/1.1 ???? ?????? ???????? ????????? ???????: GET /ajax_switch&nocache=29860.903564600583 Host: 10.0.0.20 User-Agent: Mozilla/5.0 (Xll; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-ZA,en-GB;q=0.8,en-US;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Referer: http://10.0.0.20/ Connection: keep-alive
<!DOCTYPE htrl> <html> <head> <title>Arduino Web Page</title> <script> GetSwitchState() function { = + Math.random() * 1000000; nocache var request = new XMLHttpRequest(); request.onreadystatechange = function() { if (this.readyState == 4) { if (this.status == 200) { if (this.responseText != null) { document.getElementById( ).innerHTML = this.responseText; > State</button> } } > request.open( , * nocache, true); request.send(null) ; > </script> </head> <body> AJAX Switch Status</h1> <h1>Ardumo <p id= >Switch state: Not requested...</p> <button type= onciic<= >Get Switch </body> </html> ????? Arduino ???????? ???? ?????? (?????????? ????? ajax_switch), ?? ????- ?????????? ???? ??????????? ?????? HTTP, ?? ??????? ??????? ?????, ?????????? ????????? ?????????????. ? ???? Arduino ??????? GetSwitchState() ????????? ????????? ????????????? ?? ?????? ??? ??? ??????- Arduino ? ?????????? ????? ????????? ?????????????: ??? ?????????????: ????. ????? JavaScript ? ???????? ???????? ???? ?????, ?? ????????? ??? ???????- ?????????? ??? ??????? request.onreadystatechange = function(). ??? ??????? ??????????? ?????? ???, ????? Arduino ????? ????????. ?? ???????? ????? «??- ??????? ?????????????: ? ?? ???-????????» (??? ????? «????????? ????????????? Arduino. ?? ?????????: ?? ?????????...») ????? ???????, ?????????? ?? ???? ?????? JavaScript ?? ???????? ? ????? ?? Arduino ? ???? AJAX ? ?????- ???. ??????? JavaScript ???????? ?? ???? ?? ????? Robin Nixon \"Learning PHP, MySQL, and JavaScript: A Step-By-Step Guide to Creating Dynamic Websites\", ???. 385 (??????? 2009 ?.). ? ????? ????? ?????????, ??? ??? ????????????? GET-??????? ???-??????? ??- ??? ?????????? GET-??????. ??? ????????, ??? ?????? ?????? ????? ???????? ?????????, ?? ??????????? ??????? ?????????? ???????, ??? ??? ?????? ????? ?? ?????? ?????????? ? ?????? ??? ????? ???????????? ?????????. ???????? ?????????? ????? ? ?????? ?????? ???????? ???????????. ?? ???? ????????? ????????? (Firefox, IE, Safari, Chromium, Chrome) ???? ??????????, ??? ?????? Internet Explorer ???????? ??????, ??????? ??? ?????????? ???????? ? IE ???? ????????? ????????? ?????. ???????? AJAX, ??????????? ? ???? ???????, ????? ???????????? ????????? ??- ????? :
1. AJAX-?????? ?? ???????? ??? ??????? ?????? ?? ???-???????? ??????????? ??????? JavaScript GetSwitchState(). ??? ??????? ?????? ?????????: ? ?????????? ????????? ????? ??? ???????? ? ???????? GET: nocache = \"&nocache=\" + Math.random() * 1000000; ? ??????? ?????? XMLHttpRequest() ? ?????? request: var request = new XMLHttpRequest() ; ? ????????? ??????? ??? ????????? ?????? ???-???????: request.onreadystatechange = function() (? ????????? ??? ????? ????????? ???????? {}). ? ??????????? ?????? HTTP GET ??? ???????? ?? ???-??????: request.open(\"GET\", \"ajax_switch\" + nocache, true); ? ?????????? HTTP-??????: request.send(null); 2. ????? ?? ???-??????? Arduino ????? ???-?????? Arduino ???????? HTTP-?????? GET, ?? ?????????? ????????- ??? ????? HTTP, ?? ??????? ??????? ?????, ?????????????? ????????? ?????????- ??????????? ????. ????????? ????????????? ? ???????????? ????? ?????????? ?? ??????? Arduino GetSwitchState(). 3. ??????? JavaScript ???????????? ????? ????? HTTP ?? ???-??????? Arduino ?????????????? ????? JavaScript. ??????? ??????? Arduino ??????????? ??????? JavaScript ???????????, ????? ????? ?? ???????, ??? (??????? ??????????? ??????? — ??? ?????????? ??????????? ?????? request.onreadystatechange). ???? ?????????? ????? ? ??????? ? ?? ????, ?? ??????????? ??? JavaScript: document.getElementById(\"switch_txt\").innerHTML = this.responseText; ???? JavaScript ??????? ????? ? HTML, ?????????? ??????????????? switch_txt, ? ???????? ??????? ????? ???????, ?????????? ?? Arduino. HTML ??? ????? ?????? ???????? ????????? ???????: <? id=\"switch_txt\">Switch state: Not requested...</p> ???? ?????? ???????????? ????????????? AJAX ??? ?????????? ?????? ?????? ?????? ? ????????. ????????? ????? ????? ??????????? ????? ???????????????? ?????? AJAX, ????? ?? ????? ???? ???????? ??????, ????? ???????????? ??????. ????? 8. ?????????????? ?????? ? ????????? ????????????? ?????????????? AJAX ?? ???-??????? ARDUINO ? ????????? ???????????? ???? HTML ? JavaScript ? ?????? Arduino ?? ?????- ????? ????? ????? ??????????? ???-?????? Arduino ????? ????????? ??????????- ??? ????????? ?????? ????????????? ?? ???-????????9. ?????? ?? ???-????????, ??????? ?????????????? ??? ?????? AJAX ?? ?????????? ????? ????? ???????????, ?????? ?? ?????. ?????? ??? ?????????? ??? ????? ???????????, ??? ?????????? ?????? ???????- ??? ????? ????? ??????????? ? ?????? ??. 9 : / /www. you tube. com/watch?v=Nw5vUg8BWck https
? ?????????? ????? (eth_websrv_AJAX_switch) ????? ?????? ????? ??? ??????- ???????????- ???, ????? ???????????????? ????? AJAX, ??????? ????????? ?????? ?? ?? ???-????????. ?????????? ????? ??????? ?????: /*- e th_webs rv_A JAX_s wi tch_au to Program: the state Description: Arduino web server shows of a switch Hardware: on a web page using AJAX. The state of the is Software: switch updated automatically. References: Does not use the SD card. Date: Author: Arduino Uno and official Arduino Ethernet shield. Should work with other Arduinos and compatible Ethernet shields. Developed using Arduino 1.0.3 software Should be compatible with Arduino 1.0 + - Webserver example by David A. Mellis and modified by Tom Igoe - Ethernet library documentation: http://arduino.cc/en/Reference/Ethernet - Learning PHP, MySQL & JavaScript by publishers Robin Nixon, O'Reilly 13 February 2013 W.A. Smith #include <SPI.h> #include <Ethernet.h> // MAC address from Ethernet shield sticker under board byte mac[] ={ OxDE, OxAD, OxBE, OxEF, OxFE, OxED }; 0, 0, 20); // IPAddress ip(10, // IP address, may need to change depending on network server(80); EthernetServer create a server at port 80 String HTTP req; // stores the HTTP request void setup() { Ethernet.begin(mac, ip) // initialize Ethernet device server.begin(); ; // start to listen for clients ; Serial.begin(9600) // for diagnostics pinMode (3 , INPUT) // switch is attached to Arduino pin 3 } void loop() { EthernetClient client = server.available(); // try to get client if (client) { // got client? boolean currentLinelsBlank = true; while (client.connected()) { if (client.available()) { // client data available to read char ? = client.read(); // read 1 byte (character) from client HTTP_req += c; // save the HTTP request 1 char at a time // last of and ends line client request is blank with \\n // respond to client only after last line received if (c == 'n\\ ' && currentLinelsBlank) { // send a standard http response header client.println(\"HTTP/1.1 200 OK\"); client.println(\"Content-Type: text/html\");
client.println(\"Connection: keep-alive\"); client.println(); // AJAX request for switch state if (HTTP_req.indexOf(\"ajax_switch\") > -1) { appropriate // read switch state and send paragraph text GetSwitchState(client); } else { // HTTP request for web page // send web page - contains JavaScript with AJAX calls client.println \"<!DOCTYPE html>\"); client.println \"<html>\"); client.println \"<head>\"); client.println \"<title>Arduino Web Page</title>\"); client.println \"<script>\"); client.println \"function GetSwitchState() {\"); client.println \"nocache = \"\\ &nocache=\\\"\\ + Math.random() * 1000000;\"); client.println \"var request = new XMLHttpRequest();\"); client.println \"request.onreadystatechange = function() {\"); \"); client.println \"if (this.readyState == 4) {\"); client.println \"if (this.status == 200) {\"); client.println \"if (this.responseText != null) {\"); client.println \"document.getElementByld(\"\\ switch_txt\\\")\\ .innerHTML = this.responseText;\"); client.println \"}}}}\") ; client.println \"request.open(\"\\ GET\\\", \"\\ ajax_switch\\\" + nocache, true) client.println [\"request.send(null);\"); client.println ;\"setTimeout('GetSwitchState()', 1000);\") client.println [\"}\") ; client.println '</script>\"); client.println '</head>\"); client.println '<body onload=\"\\ GetSwitchState()\"\\ >\"); client.println '<hl>Arduino AJAX Switch Status</hl>\"); client.println i \"<p id=\"\\ switch_txt\\\">Switch state: Not requested...</p>\"); client.println \"</body>\"); client.println \"</html>\"); } // display received HTTP request on serial port Serial.print(HTTP_req); HTTP_req = \"\"; // finished with request, empty string break; } // every line of text received from the client ends with r\\ \\n if (c == 'n\\ ') { // last character on line of received text // starting new line with next character read currentLinelsBlank = true; } else if (c != '\\r') { // a text character was received from client currentLinelsBlank = false; } } // end if (client.available()) } // end while (client.connected()) delay(1); // give the web browser time to receive the data client.stop(); // close the connection } // end if (client)
} // send the state of the switch to the web browser void GetSwitchState(EthernetClient { cl) { state: if (digitalRead(3)) state: cl.println(\"Switch ON\"); } else { cl.println(\"Switch OFF\"); } } ?? ??????????? ???? ???????? ?????????, ????????? ? ???? HTML, ??????? ????? Arduino ?????????? ? ???-??????? (???? ???? ???????????? ????????? ? ??????? client.println() ? ??????). <!DOCTYPE htrl> <html> <head> <title>Arduino Web Page</title> <script> GetSwitchState() function { = + Math.random() * 1000000; nocache var request = new XMLHttpRequest(); request.onreadystatechange = function() { if (this.readyState == 4) { if (this.status == 200) { if (this.responseText != null) { document.getElementById( ).innerHTML = this.responseText; line > added this this line removed > > } request.open( , + nocache, true); request.send (null) ; setTimeout( , 1000); // new <— } </script> </head> <body onload- > <— modified <h1>Arduino AJAX Switch Status</h1> <p id= >Switch state: Not requested...</p> </body> </html> ??? ?????? ???-???????? ???, ??????? ??-??????, ??????? ?????? ?? ???-????????, ??? ??????, ??? ??? ?? ?????. ??? ????? ?????? ?????? ??????? ?????????????????? ?? ??????????? ????. ????? ??????? GetSwitchState() ??????? GetSwitchState(), ??????? ?????? ?????????? ??? ?????? ??????? ??? ???????? ???????? ????? ?????? ??????, ?????? ?????????? ????????. ???
???????, ????? ?????????? ??????? ???????? ????????, ????? ????????? ???? <body> ? HTML: <body onload=\"GetSwitchState()\"> ??????? ????????? ??? ??????????? ? ????? Arduino ? ?????? ????: client.println(\"<body onload=\"\\ GetSwitchState()\"\\ >\"); ????? AJAX ?????? ??????? ??????? GetSwitchState() ????? ?????????? ?????? ???? ??? ??? ???????? ???- ????????, ???? ?????? ?? ?? ??????? ??? ??? ?????????????? ?????? ???? ????- ???. ????? ????????? ?????? ???? ??????????? ? ????? ??????? GetSwitchState(), ?????? ?????????, ??? ??? ??????? ?????????? ???????: setTimeout('GetSwitchState() ' 1000); , ??? ?????? ???? JavaScript ???????? GetSwitchState() ?????? 1000 ???????- ????? ???? (?????? ???????). ??????? ?????? ??????? ??????????? AJAX, ??????? ???????? ?????? ??????????? ? ????????? ??? ?? ???-????????. ???? ??? ??????????? ?? ???-???????? ????? ?????????? ???? ?????? ? ????? Arduino: client.println(\"setTimeout('GetSwitchState()', 1000);\"); ????? 9. ?????????? ????? ? ????????????? ? ?????????????? AJAX ?????????? ????????? ????? ??? ?????? ?????????????, ????????????? ? ???- ? ????? ??????? Arduino, ??????????? ???????? ?????? ?? ?????????? ??????10. ???????????? JavaScript ??? ?????????? ??????? AJAX ??? ??????? ????????? ? ??????????? ????????????? ???????? ? ???-???????. 5V ?2 5wi -?. ? -? O SW2 7 ?O ARDUINO 3£ UNO ?) iok |-3- GND RVl https://www.youtube.com/watch?v=0CcsDPmPrtc
?? ??????????? ???? ?????????????? ????? ????????, ??? ????????????? ???- ???- ??????? ? Arduino (? ???????????? ? ???? ?????? Ethernet) . ???????????? ? ????- ?????? ? ??????????? ??? ????? ?2, ??? ??? ???????? ?? ?2 ????? ???????? ???? ?? ???-????????. ????? Arduino — ???????????????? ?????? ?????? ?? ??????????? ?????. h e th_web s rv_AJAX_IN Program: Description: Uses Ajax to update the state of two switches page. The Arduino Hardware: and an analog input on a web Software: web server hosts the web page. References: card. Does not use the SD Date: Author: Arduino Uno and official Arduino Ethernet shield. Should work with other Arduinos and compatible Ethernet shields. Developed using Arduino 1.0.3 software Should be compatible with Arduino 1.0 + - Webserver example by David A. Mellis and modified by Tom Igoe - Ethernet library documentation: http://arduino.cc/en/Reference/Ethernet - Learning PHP, MySQL & JavaScript by publishers Robin Nixon, O'Reilly 20 February 2013 W.A. Smith -*/ #include <SPI.h> #include <Ethernet.h> // MAC address from Ethernet shield sticker under board byte mac[] ={ OxDE, OxAD, OxBE, OxEF, OxFE, OxED }; 0, 0, 20); // IPAddress ip(10, // IP address, may need to change depending on network server(80); EthernetServer create a server at port 80 String HTTP req; // stores the HTTP request void setup() { Ethernet.begin(mac, ip); // initialize Ethernet device server.begin(); // start to listen for clients Serial.begin(9600); // for diagnostics pinMode(7, INPUT); // switch is attached to Arduino pin 7 pinMode(8, INPUT); // switch is attached to Arduino pin 8 } void loop() { EthernetClient client = server.available(); // try to get client if (client) { // got client? boolean currentLinelsBlank = true; while (client.connected()) { if (client.available()) { // client data available to read char ? = client.read(); // read 1 byte (character) from client HTTP_req += c; // save the HTTP request 1 char at a time // last of and ends line client request is blank with n\\ // respond to client only after last line received if (c == 'n\\ ' && currentLinelsBlank) { // send a standard http response header
client.println(\"HTTP/1.1 200 OK\"); client.println(\"Content-Type: text/html\"); client.println(\"Connection: keep-alive\"); client.println(); // AJAX request for switch state if (HTTP_req.indexOf(\"ajax_switch\") > -1) { input // read switch state and analog GetAjaxData(client); } else { // HTTP request for web page // send web page - contains JavaScript with AJAX calls client.println \"<!DOCTYPE html>\"); client.println \"<html>\"); client.println \"<head>\"); client.println \"<title>Arduino Web Page</title>\"); client.println \"<script>\"); client.println \"function GetSwitchAnalogDataO {\"); client.println = \\\"&nocache=\"\\ + Math.random() * 1000000;\"); \"nocache client.println \"var request = new XMLHttpRequest();\"); client.println \"request.onreadystatechange = function() {\"); client.println \"if (this.readyState == 4) {\"); client.println \"if (this.status == 200) {\"); client.println \"if (this.responseText != null) {\"); client.println \"document.getElementByld(\"\\ sw_an_data\"\\ )\\ .innerHTML = this.responseText;\"); client.println i \"}}}}\") ; client.println i \"request.open(\\\"GET\\\", \"\\ ajax_switch\"\\ + nocache, true);\"); client.println [\"request.send(null);\"); client.println [\"setTimeout('GetSwitchAnalogDataO ' ,1000) ;\") client.println [\"}\") ; client.println '</script>\"); client.println '</head>\"); client.println [\"<body onload=\\\"GetSwitchAnalogData()\"\\ >\"); client.println ;\"<hl>Arduino AJAX Input</hl>\"); client.println '<div id=\"\\ sw_an_data\"\\ >\"); client.println '</div>\"); client.println [\"</body>\"); client.println '</html>\"); } // display received HTTP request on serial port Serial.print(HTTP_req); HTTP_req = \"\"; // finished with request, empty string break; } // every line of text received from the client ends with \\rn\\ if (c == 'n\\ ') { // last character on line of received text // starting new line with next character read currentLinelsBlank = true; } else if (c != 'r\\ ') { // a text character was received from client currentLinelsBlank = false; } } // end if (client.available()) } // end delay(1); while (client.connected()) // give the web browser time to receive the data
client.stop(); // close the connection } // end if (client) } // send the state of the switch to the web browser void GetAjaxData(EthernetClient cl) { int analog_val; if (digitalRead(7)) { cl.println(\"<p>Switch 7 state: ON</p>\"); 7 state: OFF</p>\"); } 8 state: ON</p>\"); 8 state: OFF</p>\"); else { \") ; cl.println(\"<p>Switch } if (digitalRead(8)) { cl.println(\"<p>Switch } else { cl.println(\"<p>Switch } // read analog pin A2 analog_val = analogRead(2); cl.print(\"<p>Analog A2: cl.print(analog_val); cl.println(\"</p>\"); ??????????? ???? ????? ??????? ????????? HTML-???: <!DOCTYPE h: 1> --html-> <head> -:title>Arduino Web Pagc/titlc> ^scr ipt> function GetS/.itchAnalogData( ){ nocache ~ * Math.random() * \"Ouuj-jj; var request - new XMLHttpRequestC); request.onreadystatechange - function() { if (this.rcadyState -- null) :) { if (this.status == 100) { if (this.responseText !- { document.getElementById( ).innerHTML - this.responseText; > > } > request.open( , * nocache. true); request.send setTimeout( (null) ; ' , 1 O. ); > ^/scnpt> </head> «-body \"m! »,-* i- > <h1>Arduino <div ::i\" AJAX Input</h1> d/*- l v > </body> </html> ???????? 7 ? 8 Arduino ????????? ??? ????? ? ????? setup() ??????. ??????? JavaScript, ??????? ???????????? ????? AJAX, ???? ?????????????.
??????? Arduino, ?????????? ?? ????? AJAX, ????? ???? ?????????????. ??? ?????????? HI ? HTML-???? ??? ?????? HTML-??????? <div> ? ????????????- ??? «sw_an_data». ?????? div ??????? ?? ????????, ?? ?? ?????? ?????? ??? ? ?????????? ?????????? JavaScript ?????????? (?????????????? ????????), ??- ?????????? ??????? ? Arduino. ???????? ??????? ?????? ?? ???????? ??????? JavaScript GetSwitchAnalogData() ?????????? ?????? ???????. ?????? ??????? ?? ?????????? ?????? GET ?? ???-?????? Arduino. ????????? ? ????????? ??????? AJAX ?? Arduino ????? Arduino ???????? ?????? AJAX, ?? ????????? ??????? GetAjaxData(). ??? ??????? ????????? ????????? ???? ?????????????? ? ?????????? ??????? ???????- ??????? (??? ??? ????) ??????? ? ???-???????. ??????? ????? ????????? ?????- ??? ??????????? ???????? ?2 ? ?????????? ??? ??????? ? ???????. ??????????? ????? ?????? ? ???-???????? ????? ???-??????? ???????? ??????, ??????????? ?? Arduino, ?? ?????? ?????- ???? ?? ? div ? ??????????????? sw_an_data. (??????????? ???????)
??????? ??????? ??????? ????? ???????? ?. ???????? ????????????? ?????, ??? ??????? ????? (????. Tesla coil), ??? ?????? ????? ?????? — ??????????, ???????????? ??????? ? ??????? ??? ???. ???????? ????- ??????? ???????????????, ???????????? ??????? ?????????? ??????? ???????. ?????? ??? ???????????? 22 ???????? 1896 ???? ??? «??????? ??? ???????????? ????????????? ????? ??????? ??????? ? ??????????». ????????????? ????? ??????? ?? ????????????? ??????????? ??????? ???????- ????????? ???? ? ????????. ??? ????????? ??????? ???????? ????????? ????? ?????? ? ???????? ?????? ????????? ?????????????? ???????, ??????????? ? ???? ????? ??????????? ? ???????? ??????????. ????????? ???????? ?????? ?????? ??- ????? ???????. ??? ?????????? ??????? ????????? ?????????????? ??????? ???- ??????? ?????? ? ???????? ?????? ?? ??????????? ????????? (??????? ????) ???- ?????? ??????? ?????????? ??????? ????????? ?? ????????? ??????? ????????? ??????? ???????????????? ????? ? ????? ??????? ??????? ???????? ??????? ????- ?????? ??????????.
??? ????, ????? ????? ??????, ??? ????????????? ?????? ??????????? ???????, ??????? ? ?????? ? ????? ??????? ????? ??????? ??????????, ?????????? ??????, ??????- ???????. ??????? ??????????? ?????? - ??? ????????????? ??????, ??????? - ??? ??? ???????. ?????? ???????? ?????? - ??? ??? ?? ????????? ???????, ? - ???? ???????????? ??????????. ??????? ??????? ??????, ?, ????? ??????? ???????? ? ??? ???????. ? ???, ?? ????????? ???????, ?????? ??????????? ? ????????? ??? ??????, ??? ??? ?????? ???????? - ??? ???????? ????? ???????. ???? ????? ?????????? ? ? ??????, ?????? ????? ??????? ?????????? ??????? ?????, ?????????? ?????? ??????? ? ?? ????? ??? ?????????? ???????. ???????????, ??????????? ?????? ????? ?? ?????? ???, ? ? ?????? ???????? ? ?? ???????????? ???????????. ?????????? ????????? ?????? ? ??????? ????????- ?? ????????????? ???????\". ??????? ?????????? ?????? ??????, ?? ?????????? ???????? ??????? ?? ?????- ??, ?????????? ??????????? ?????. ???? ??????? ????? ????????? ??????? ?????? ????? ?????, ?? ?? ????????? ?? ????? ??????, ?? ?????? ?????? ??????????? ?????? ?? ????? ????. ? ????? ?????? ???????, ??? ??????????? ????? ????? ???????. ???? ?????? ? ??????? ????????????? ????? — ??? ?????? ???????? ??????????????. ?????? ?????????? ????????, ????? ??????? ?????? ??????? ???????????? ????- ??. ? ???? ?????? ??????????? ????? ???, ? ?????? ??????????? ??????? ?????? - ??????? ?????? ?? ?? ??????. ?????? ???????? ??????????? ??????, ?? ? ???? ????????? ???? ????? ????? ???????, ????-???? ?????? ?? ?????? ?????? ??????- ???. ????? ?????? ? ???? ???????? ?????????????? ?????. ? h\\ i\\ft .1 1 in ??? 1 1 hi II 1 11 i 11 1 ! ????? ????, ??? ?????? ??????????? ?????, ??? ??????? ?? ????????? ?????? ??????- ?????? ???????, ?? ??? ???? ???????? ?????????? ????? ?????????? ??????. ?????? ?????????? ???????????. ??????????? - ??? ????????????????? ?????? ? ???????. ???? ?????? ????? ??????? (?????? ???????????), ?? ??????? ?????? ??????????? ???????? ?? ?????? ?? ?????????. ????? ???????, ??????????? ????? ? ??????????? ??????? ?????? ???? ???????????? ??? ?????????? ???????????? ?????? ?????? (???????????? ?????? ????????). ??? ??? ??????????? ????????? ??????? ? ?????????????? ????? - ???????? ?? ?????????? (??? ??????? ?? ????????) , ?? ??????????? ??? ??? ???????? ????? ?? ??????, ? ??????? ?????? ????????? ??????? ?????. ?????????? ????????????? ????? ???????? ? ???? ??????? ?????????????, ??-
????? ?????????????, ????????? ?? ???? ??????? — ????????? ? ?????????, ???- ?????????? ?????? (???????????, ????? ??????????? ? ???????? ??????? Spark Gap), ??????- ?????, ?????? (???????????? ?? ??????) (?? ????? ??????? ??? «??- ???») . ???????? ??????????? (?????) ??????? ????????? ????????? 9?????????| ??????? ??????? ????????? ??????? ?????? ???????? ????? ????????? ?????? ?????? ?????? ??? ??????? ???????? ????????, ? ????????? ????? 1000 ?????? ??????? ??????? ???- ???? ???????. ????????? ??????? ????? ???? ??????? (??????????????), ??????- ???? ??? ?????????????? (????????????). ? ??????? ?? ??????? ???????????????, ????? ??? ??????????????? ??????????. ????? ???????, ?????????????? ????? ????? ????????? ??????? ??????, ??? ? ??????????????? ? ?????????????? ???- ????????. ????????? ??????? ?????? ? ????????????? ???????? ????????????? ??????, ? ??????? ??????? ?????????? ??????? — ?????????. ?????????, ? ?????????? ??????, ???????????? ???????, ???????????? ????? ??? ????????? ????????? ? ???????????? ???????. ????????? ?????? ???? ?????- ???? ? ?????????? ??????? ????? ????? ????????????? ???? ????? ???? ? ????? ??????? ??????????. ????????? ??????? ????? ???????? ????????????? ??????, ??? ???? ??????????- ??, ??????? ???????, ????????? ??????? ??????? ? ??????????? ??????????? ??- ????? ????? ???????. ????????? ??????? ????? ????????? ????? ?????????? ????? ??? ???? ??? ?????????????? ?????????????? ??????. ???????? ????? ???? ???????? ? ???? ?????, ??????????? ????? ??? ????? ? ???????????? ??? ????????? ????????????? ???????? ???????? ??????? ?????. ????? ???????, ????????????? ????? ???????????? ????? ??? ????????? ??????- ??????? ???????, ??? ? ?????????? ??? ????????????? ???????? ? ???????? ????- ??? ??? ???????? ?? ??????? ???????????????. ??? ??????????? ?????? ????????- ?????? ??? ??? ????????????? ??????? ?????? ???? ????????? ?? ???? ????????- ??? ???????. ?????? ? ???????? ????????? ???????????? ????????? ?????? ??? ??????? ?????????? ????? ????????? ??????? ???????????? ? ????? ?????? ???- ?????? ??????? ?? ????????? ????????????? ?????????? ?? ?????? ????????????- ??. ????????????? ????? ??????????????? ?????????? ???????????, ?????????? ?? ?????, ???????? ? ?????????? ??????. ?????? ???? — ??? ????? ???????????? ?? ?????????? ?????? ??????????. ?????? ???? — ????????? ??????????????? ??????- ??? ? ????????? ???????. ?????????, ?????????? ???????????, ??????? ???????? ??????? (?????????????), ????????? ??? ?? ???????, ????? ???????? ??????? ?????? ???????????? ?????? ? ????????? ?????? ? ???? ??????? ??? ???????????. ?? ???????? ??? ??????? ????? ?? ????? ??? ????????? ????? ???????, ??????? ? ????? ?????????????? ????? ????????? ?????? ???????? ??????????? ????????? ???????.
????? ???????????? ???????????? ??????? ?????????? ???????? ?????????? ?? ???? ??????????? ??????????????? ??????????????. ??????? ???????????? ??????- ???? ????? ???????, ????? ?????? ? ?????????? ??? ?????????? ??????????? ???- ??? ? ???????? ?????????, ?????? ??????????????? ???????. ?????? ??????? ??- ??? ?????????? ?? ????????? ?? ??????? ???????1, ??? ??? ? ?????? ??????? ??- ???????? ???????? ?????? ?? «???????» ??????? ???????. ?????????? ?????? ?????????? ??????????? ?????? ??????????, ???????, (? ?????? ?????????? ??????????), ????? ????????????, ??????? ?????????? ????? ?????. ? ???- ??????????? ??? ?? ?????? ?????????? ?????? ???????????? ????? ?????? 2—20 ?????????. ????? ?????????? ????? ??????????? ?????????? ?????????? ??????, ? ??? ???- ??- ?????? ?????????????? ????????????? ?????? ????. ??????????? ??????????? ??? ????????? ?? ???????. ????? ??????? ????????????, ?????????? ?????? ???- ??????? ????? ??????????? ??-?? ?????????? ? ???? ????????? ?????? (?????). ??????? ???? ?????????????? ???????, ?????????? ?? ????????? ??????? ? ???- ?????????, ???????? ????????? ????? ?????????, ? ? ??? ????????? ?????????- ?????? ?????????. ????????? ?????????? ????????, ? ????????, ??-?? ?????? ? ?????????? ? ? ???? ????????? ???????, ?? ???????????? ?? ??? ???, ???? ??? ??????? ??????????? ?????????? ????????? ?????? ??? ??????????? ???????. ?? ????????? ???? ????????? ??????????? ?????????, ??? ???????? ? ????????? ?? ????????? ???????? ??????????. ?? ???? ????? ??????????????? ????? ???????? ??????? ??????????? — ??????- ??? ?????? ??? ? ????????? ??????? — ???????? ??????????. ??????, ???? ?? — ????????? ??????????????? ????????? ????? ????? ????????? ???????????. ? ??- ??????????? ???????? ??????? ?????, ???????? ?????????? ?????, ????? ??????- ?????? ????? DC, ???????? DCSGTC. ?? ?????? ?????? ??????????: ? SGTC (????. spark-gap Tesla coil) — ???????????? ??????? ????? — ????????? ????????? ???????? ?? ???????? ?????????? (??????????). ??? ?????? ?????- ?????????? ????? ?????? ? ???????? ???????????? (????????????) ??????????- ?? ????? ??????? ??????????? ??????????. ????????, RSG (?? ????. rotary spark gap, ????? ????????? ??? ????????/??????????? ???????? ??????????) ??? ??????????? ???????? ?????????? ? ??????????????? ???????????????? ????????????. ? ???? ??????, ??????? ?????? ?????????? ????????????? ????- ???? ????????? ??????? ?????????? ????????????, ? ????? ? ???? ?????? ???- ?? ? ????????, ? ?? ????, ??? ??? ????? ???????. ? ??????????? ????????? ????????? ?????????? ???????????? ????????? (?????? ??? ????????????????), ????????? ???? ? ???????????, ??????? ????????????, (??? ?????? ????????), ? ???????? ?????????? ??? ????????? ?????????? ???????. ???????? ???????? ???? ? ???????????? ????????? ?????????? ?????? ?? ??????????? ??????? ?????????? ????? ?????????. ????????? ?????????? ? ??????????? ???????? ???????? ?????????? ? ??????????? ?? ?????????? ??????????. ????? ??????- ??????? ???????????? ????????? ?????????? ?????? ??????? ??????????? ???- ?????????? ?????????? ???? ????? ???????????. ?????? ??????? ??????????? ????????? ???????? ???????????????? ??????????? ???????????. ??? ???????- ??? ???????????, ?? ?????? ???????? ? ?????? ??? ???????????? ???????????, ????????, ? ?????. ??????? ????? ??? ??????? ???? ? ??????????? ?????????? — ??? ???????? ?????????? ?????? ?????? ???????. ?????? ???????????? ???- ???????? ????????? ??????, ???????? ???????????. ??? ?????? — ?????? ??- ?????? (????????????? ?????) ?? ?????????????? ????????. 1 = 2rcsqrt(LC), ??? ?0 — ?????? ??????????? ?????????; L— ?????????????; ?— f0 — ?0 ???????. ??????? ??????????? ????????? - ????? 1/?0.
? ???????? ??????? ????? (???) (????. vacuum-tube Tesla coil, VTTC). ? ??? ? ???????? ?????????? ?? ????????? ???????????? ??????????? ?????. ??????, ??? ?????? ???????????? ?????, ????? ??? ??-81, ?????? ??????????? ? ????- ? ??- ?????? ???????????. ???? ?? ???????????? — ?????????? ????????????? ?????????? ????? ??????????. ??? ????????? ???????????? ????????? ???????? ??? ?????? 300—600 ?. ????? VTTC ??????????? ?? ?????? ????, ????????????? ??????? ????? ?? ???????? ??????????. ? SSTC (????. solid-state Tesla coil) — ????????? ???????? ?? ????????????- ???. ?? ???????? ? ???? ???????? ????????? (? ???????????? ????????, ???- ???, ????????????? ?????????) ? ??????? ????? (?????? ??????? MOSFET ????- ???????) . ?????? ??? ??????? ????? ???????? ????? ?????????? ?? ?????????? ????????: ??????? ??? ??????? ?? ??????, ????? ??????????? ???????? ????- ??? ??? ???????. ????? ?? ?????? ?????????? ????? ??????????????? ???????. ???????? VTTC. ????????, ???????? ??????? — ???? ????? ???????? ?? ?????? ????- ???, ?????????????? ???????? (? ?????????? ???????????) ?? ? ?????? ????????????, ????? ??????? ?????? ???????? ?????????? ? ?????????? ?????- ?? ????????? ??????????, ??? ? SGTC. dual resonant solid-state ? DRSSTC (????. Tesla coil) — ?? ???? ???????? ??- ???????, ??????? ? ?????? ???? ??????? ??????????? ??????, ??? ? ??????? SSTC. ??? ??????? ?????????? ??????? ???????????? ????????? ?? ??????????- ??????? ?????? — IGBT ??? MOSFET ????????????. ? QCW DRSSTC (????. quasi-continious wave) — ?????? ??? ????????????? ????- ??? ?????, ?????????????????, ??? ??????????, ??????? ????????: ????????- ??? ? ???????, (? ?? ?????? ???????, ??? ? ??????? ????????), ??????????? ???? ??????????, (? ??????: ?????????? ?????????? ??????? ? ???? ????????- ?? ???????, ?, ????????, ?????????? ?????????? ???????). ? ???????????? ??????? ????? ?????????? ???? ???? ? ????????? ??????? ?????? ?????????? ? ????????? 2—3 ?? 7—10 ? ????? ??????? ???????, ? ????????????? ??????? (?? ????????) ??????????? ???????, ?? ????, ?? ????? ??????? ???????? — ????? ???????????. ? QCW ????? ?????????? ?????????? ??????? ???????????, ?? ??? ???????. ????, ?????? ???????? ?? ??????? ???????? ?????-QCW ???????? ????????. ???????? ??????? ????? ? ??-?? ??????????????? ??????? ???????? 50 ???? ?? ??? ?????? ????????? ?????? ??????????? ???????, ??????? ????- ???????? ???????? ???????????? ??????? ????? ??????? ???????????? ???????- ?? ???????? ?????????? (?? ??????, ??? ?????). ? ?????????? ??????? ?????? ??????????? ??????????? ??? ?????? ? ???? ??????? ? ??????????? ??????, ?????????? ????????, ????? ??????? ??????????? ????????? ????? ??????? ???????. ???, ??? ????????? ????????? ???? ? ?????? ?????????? ?? QCW ?????????? ??? DRSSTC ??????? ?? ????????? ??? ????????? ???????: ?????? ???????? ???????? ?????????, ??????? ?????????. ????????? ?? ????????? ??- ???????? ??????? ?????????? ????????????? ???????? ? ??????? ????? ??????? ???????, ? ??????? ?????? ?????, ?? ??????? ?????? ????, ?????? ????, ???- ?? ??????????? ????? ??????? ?? ??????????. ?????? ??? ????? ? ???????? ??????? ??????? ? ???????? ?????. ?? ???? ?????? ?????? ??????????? ???- ????????? ?????? ??????: ??????? ?????????? ?????????? ??????, ??????? ????? ?????? ?? ? ??????? ?????????, ???????? ???????? ????? ? ????????? ???????????, ????? ???????? ? ? ?????? (???, ??? ???? ??????? ???? ??????? ??- ???????????) , ??? ????????????? ??? ?????????????? ? ???????? ???????????? ??????????? ????? ????????? ??????? ?????. ?? ????, ?? ????????? ????????? ????????? ??????, ??????? ?????????? ?? ???? ????????? ??????? ?? ??????- ??? ???????. ?? ?????????? ?? ?????? ????? ??????? ????? ???????? ? ?? ????????? ???????? ?????????. ? ????????? ????????? ????? ??????? ??????????? ??????? ?????.
???????? ?????????? ?????????????? ????? ????? ????????? ?????????? ??????- ???- ??? ?????. ??? ?????????? ? ??????? ??????????? ????????????? ????????? ? ???????, ??????? ???? ???????? ????????? ???????????? ????????????? ??????? ????? ????? ????????????? ?????. ??? ??????? ??????????? ????? ?? ?????? ???- ????? , ??????? ????????????? ????? ???????????? ??? ???????????? ???????. ?????? ????????????? ????????????? ??? ????????? ? ??????????????? ???????- ?? ?????? ?????????, ???????????? ?????????? ???????????? ?? ?????????? ??? ???????? (???????????????), ???????????? ???????? ?????? (?????) ? ?????????- ??? ???????? ???????. ? ?????? XX ???? ????????????? ????? ????? ????? ????- ?????? ????????????? ? ????????. ????????? ???????????? ??????? ????????????- ???? ??????, ???????, ???????? ?? ??????? ???? ??????????? ????, ?? ????????? ????? ?????????? ???????, ???????? ??? ???? «????????????» ? «????????????- ???» ???????. ????? ????? ??????? ?????? ? ?????? ???????, ??? ??????????????? ?????. ???? ????? ????????????? ????????? ???: ????????????? ?????????, ???????? ??- ??????????- ????????, ???????? ???????, ?????????, ??????? ??????, ???????? ??????? ?????????, ??????????? ???? ?? ?????? ????????. ?? ????? ?????? ??????? ????? ??????? ???????? ???????, ????????? ? ??????- ?????? ????????? ????? ??????? ????????. ?????? ???? ???????? ?????????????? ????? ???? ????, ????? ?????????? ?? ??? ????????????, ???????? ???????. ? ????? ??????? ????? ?????????? 4 ???? ????????: — ?????? 1. ??????? (?? ????. Streamer) ?????????? ?????? ????????????? ????- ??, ??????? ???????? ?????????????? ????? ???? ? ??????????? ?? ??? ???- ?????? ?????????. ????????? ?? ????????? (??? ?? ???????? ??????, ??????- ?????? ??-??????) ??????? ????? ? ??????, ?? ????? ? ?????, ??? ??? ????? ?????????? ??????? ? ??????????? ??????? ????? ?????? ? ?????. ??????? — ???, ?? ???? ????, ??????? ????????? ??????? (???????? ?????), ??????????? ??-????? ??????????????. 2. ????? (?? ????. Spark) — ??? ???????? ??????. ???? ? ????????? (??? ? ???- ?? ??????) ?????- ????? ??????, ???????????? ??????????????? ? ????? ??? ? ???????. ????? ?????? ???????????? ????? ?????, ?????? ?????????? ??? ???- ?????? ???? ????? ??????????, ????? ?????? ????????????? ??????? — ?????- ????? ??? ???????. ????? ????? ?????? ??? ????????? ??????? — ?????????? ???????? ??????. 3. ???????? ?????? — ???????? ????? ??????? ? ????????????? ???? ???????? ??- ????????. ??????? ???????? ??????????? ???????? ?????? ??-?????? ????????- ??? ? ??????? ????????? ???????????. 4. ??????? ?????? — ?????????? ?? ?????? ???????. ????????, ??? ??????????? ???????? ??????????????, ???? ? ??? ????????? ?????? ???????? ??????????? ???????, ????? ??? ? ?????????? ????? ?????????? ???? (?????? ????? ????- ??????????? ???????????? ????????? ? ????????? ? ????? ????????? ????, ??- ?? ??????? ???????? ??- ???? ??????? ??????????). ??? ??????????? ???????? ?????? ?????. ???? ??????? ???????????? ????? ? ???????, ?? ?????????????- ??? ??????? ?????? ????? ????????? ?? ??????????. ????? ????? ????????? (???????? ?????? ?????? ???????), ??? ??????? ???? ?? ?????? ?? ????? ??????? (?? ????????? ? ?. ?.), ?? ? ? ?? ??????? ?? ?????- ?????? ?????????. ????? ?? ????? ????????? ????? ????????? ? ???????? ??????. ????? ????? ????????? ????? ??????? ??????. ????????? ????????, ??? ????????? ????????? ?????? ?????????? ????????, ?????????? ?? ????????, ???????? ?????? ?????? ??????? ???? ???????. ????????, ???? ?????? ????? ?????? ?? ?????????, ? ???? — ?? ???????. ?????? ???????????? ?????????????? ?????????????? ??????????? ????????????? ???????. ????????? ????? ??????? ??????? ? ???????????? ????????? ? ???????? ??????, ??????? ?????????????? ?????? ???????????? ???? ???? ? ??????????
???????, ???????????? ? ???. ?????? ????? ?????? ???????????, ? ??? ????????- ??? ???????? ????? ?????????? ????????, ? ?????????? ???? ?? ????????? ????- ???????? ??????? ?????- ??? ?????. ???????????? ??????? ???? ?? ????????????? ???? ????, ?????????????? ??? «?????» ?????. ?????????? ?? ?????? ?? ??, ??? ?????????? ????????? ????? ??????? ?????, ? ???? ??? ???? ????? ?????. ?????? ?????? //?1 ' ???????? ???????? / ???????? ?????? ???????? ?? ???????? ?????????? ?????? - ????????? ??? ???????. ?????? - ?????????? ??????????? ??????? - ??? ????????? ??? SSTC ? DRSSTC, ??? ??? ??????? ?????????????? ????? ???????? ?? ??????? ????????. ?????? - ?????????? ??????? ????? ???????????? ????????. ??? ?????? ??????, ??? ?????? ? ??? ????????? ??????? ?, ? ??????, ????? ?????? ???????????, ?????? ?????? ??? ??????? ? ???????, ????? ???????, ?????????? ???. ??? ??- ??, ????? ??????? ?????? ?? ????? ??????? ? ?????? ? ??????????? ???????? ???????, ?????????? ???????????. ?????? - ???????????? ??????????????????? ????, ??????? ??????????? ??????? ?? ????????? ??????? ?????. ?? ?????, ??? ??????? ????????? ???? ????????? ???????, ?? ?????? ????? ?? ?????? ??????. ?????? ?? ??????? ??????????????- ????? ???????????? ????????, ?? ?? ???? ?? ??????????? ???? ?? ????????. ?? ????????????? ???????? ?????? ????? ???????? ????? ? ?????????? ???????? - SGTC, DRSSTC ? ????? ? ?????????????. ???????? ??????? ??????? ??????? - ??? ???????? ????????2. ??????? ?????? ????????????? ?? ??????????? ?????, ???? ???? ????????? ???- ??? ??????????. ???????? - ???????? ?????? ?????. ????? ? ?? ???????? ??????? 4:1 - 5:1. ????????? ?????? ???????? ??????? ??????? ??????? ??? ??????? ????? ?????? ???????? ???, ????? ?? ???????? 800-1200 ?????????? ??????. ????????, ?? ????? ?????? ??????? ????? ?????? ?? ??? ??????? ??????????? ??? ????????? ??????? ? ?????????? ?????? ? ???????? ?? 5:1
???????? ?????? ????????. ????? ?? ???????? ????? ??????????? ??? ????? ????- ??? ???? ??????????? ? ?????3. ? ????????? ??????? ?????? ?????????? (Cs) ???????? ???????? ????????????? ??????, ??????? ??????????? ?????????? ??? ???????. ????? ???- ????????? ???? ??? ??????? ? ????????????? ??????? ??????, ? ???? ??????????. ????? ???????, ??? ?????? ??????? ?? ??????? ? ??? ?????? ?????????? ????- ???. Cs ??? ?????? ?? ??????? ? ?? ?????????? ??????, ????????? ??????? ?????? ??- ??????? ??????. ???? ????? ??? ????? ??????????? ?????????? ????? ? ???????- ??????? ???. ????? ?????????? ????? ??????? ??????. ??????, ?? ????????, ??- ????? ??????? ????. 3-5 ?????? ????? ?????? ???????? ?? ???????-?????? (?????) ???, ??? ????, ??????????????? (?????) ??? ??????. ????? ??? ????? ????? ? ????? ???????????? ????????. ???????? ?????? - ????????????? ??? ????, ????? ???????, ????? ? ????????? ??????? ?? ????? ??????????? ?? ?????. ??? ?????? ??????????????? ?? ?????, ???? ?????? ???????? ?????? ?????? ????????? ???????. ???????????? ????? ??- ????????? ????? ??????? ??????? (???? ?????, ??????? ?????, ??? ???, ?? ????- ???? ??????????????? ????????). ???????? ?????? ??????????? ?? ????? ???????- ??? ????????? ????????. ????????? ???????4 - ?????? ??????????????? ?? ?????? ????? ??? ??????????- ??? . ?????? ???????? ????? ????????? ?????????????? ??? ????, ????? ?? ??? ???? ????? ?????????? ??????? ???. ??????? ?????? ?????? ???????? ?? ????, ? ??????????? ??????????? ???????, ????? ?????? ?? 6 ?? ??????. ????? ? ??????- ?? ???????? ?????????? ??????? ???????? ???????. ???????????? ????????? ??????? ??????????????? ???, ????? ?????????? ?????? ??????????? ?????. ????? ?????? ???? ???????????? ???????? ? ??? ??????, ??? ????????? ?????? ?????? ????????? ???????? ???????????. ????? ??????????? ? ???????? ? ?? ??- ?????????? ???????? ??????????? ??????? ?????????? ???????. ????????? ??????? ?????? ?????? ???????????????, ???????? ??? ??????????. ??????, ??????? ???????? ???????????? ? SGTC, ?????????? - ? SGTC ? DRSSTC, ? ?????????????? — ? SSTC, DRSSTC ? VTTC. ??? ??????? ??????????? ??? ????? ? ????????? ?????? 20???. ? ??? 4 ?????????????? ????? ??? ????????? ???????. ??????? ???????? ???- ????? ??????? ?????????? ?????????? ????? ?? ?? \"????????\" ????? ????????. \"???????\" (basefeed).
? ????? iOOOOO ? ? ? ? ? ? ??????? ? ? ? ? ? ? ? ? ?????????? ?????????????? ?????????? - ??? ?? ???????, ???? ????? ?????? ?????? ?????. ? ????? ???? ?? ???? ????????? ???????? ???? ? ?????! ??????? ??? ???????? ???, ?????????? ?? ???????? ????? ??????. ????? ???????, ???? ?????????? ????? ??????, ????????? ????? ?????? ??????- ? ????? (???????? ???? ?? ? ?? ???????? ???? ???), ?????? ????, ????? ?????- ?????? ? ??????. ?????????? ??? ????? ????, - ????????????5,6. ??? ?????? ??????? ????? ????? ?????????????? ???????? ???????, ? ????? ??- ???????? ????? ?? ??????? ???????????? ??????????????, ???? ??????? ??????? ??????????????? ???????. ????? ??????? ? ????? ??????? ????????????? 4 ?????- ????????? ?? ????????????? ????? ? ???????????????? ??????????? ?? ??????? ??????, ????????????? ??????? 220 ????? ? ?????????? 8600 ?????. ??? ??????????? ?? ?????????? ? ?? ????????? ??????????? ??????? ??? 4 ?????????????? ???? ????????? ? ????????????? ???????? ?????. ? ???????? ??????? ??????? ?????????????? ??????? ?? 5 ????? ?? 9 ???????- ???????? ??????????? ????????????? (???), ?? ???? 45 ????????????? ???????? 0,1 ??? ? ??????????? 2 ?? ???? ??????? 55 ?? ? ??????????? 18 ??. ? ????? ?????????? ??? ?????????? ?????????? ?????, ??? ?????????? ???, ??? ?????? ?????- ??????? ????? ???? ????? ?? ? ? ??????, ? ????? ????? ????????? ???????. ???????, ???? ????? ????? ?????????? ? ?????????? ?? ?????. ????? ?????? ?????????? 6 ??? ????? ???????????? ??? ?????????? ?????- ???????? ????????????, ????????! ??????????? ???????????? ????? - ????????????? ?????????? ? ???? ????????. ???????????? ??????????? ? ????????????? ????? ????. ????? ? ???????????- ?? ???????????? ??????? ??????? ?????????, ??? ????? ? ??????? ???????????, ?????? ??? ??? ??????????? ????????? ??? ??????? ???????????? ????? ???????????. ? ??????- ????? ???????????? ?????? ??????? ??????? ? ??????????? ?????????? ???????? ???????- ?? ?? ??? ????????.
?????????????? ????????????? ??????? ??????? 8 AWG, ?????? ?????? ????????? 6,35 ?? ? ???????? ????????? ??????? ? 64 ???????. 1000 ?????? ?????? ?????- ???? ???????? 0,5 ?? ?? ?????????????? ????? ????????? 10 ?? ???????? ??????- ??? ??????? ? ?????? ??????? 56 ??. ?????? ???????? ?? ??????????? ?????????- ????? ????? ????????? 11 ??. 600?? \\ ^? ????????? ???????????? ??????? ???????? 1000 ?????? ????????? ??????? ?????????????? ??????? -—^ ?????????????? ??????????? ???????? ????????????? ?????????? 8600 ????? - ????????? ??????????? ??????? ?????????? ???????, ? ????? ?????????????? ? ??????? ?????????? ? ???????????, ???. ??????????? ????????? ????????? 220
??????? ?????????? ??????? ?? ??????? ? ?????????? ?????????? ????? 250 ???, ?? ? ?????? ????????????? ????????, ????????? ????????????? ??????? ?????? ???????, ??????? ????????? ?????????, ? ?????????? ????????? ? ???????? ????? ????????? ? ????????? ?????????, ??? ???????? ? ?????????? ????? ??????. ???? ??????????? ??? ???????? ?? ?????????? ???????? 8 ??. ?? ????? ????- ????? 6 ?????????, ??????? ???????? ?????????. ???? ????????? ?? ??? ??????- ??????? ???????????? ????????? ????????? 0,37 ???. ??????? ???????? ????????? ?????????? 2800 ??./???. ????????, ??? ?? ???? ?????? ?????????? 6 ?????????, ?? ???????? 280 ????????? ? ???????. ????????? ??????? ??????????????? ? ????? ??????? ?? ?????? ?????? ??????- ??? ?\", ?? ???? ?????? ?????? ??????????? ????? ????? ??????? ????????????. ????????? ??????? ????? ?????, ?? ??? ??????? ?????????????, ? ??? ????????? — ? ??????? ?????????????? ???????. ????? ????? ?????? ??????????????? ???- ?????? , ???? ??????????? ?????????????? ????????? ?? ??????? ????. ????? ???? ??????????? ?? ????????? ??? ??? ?????? ??? ??????????. ??? ????????? ??????? ?????? ??????????? ???????????? ??????????????????. ??????? ?????? ?????????? ? ????? ?? ??????? ????? ????????????????, ? ?????? ????? ????? ????? ?????????? ??????? ?? ????????? ???????. ??? ?? ???????? ?????? ????? ????????? ??????? ? ?????? ? ????????. ??? ??- ??????. ?? ???????? ??????? ?????????? ???????? ??????????, ????????????? ????? ????? ???? ?????????? ??????. ???????? ??? ???????? ??????????? ????????? ?? ?????? ??? ??????? ????????????. ? ????? ??????, ???? ??? ?????????? ??????????????? ??- ???????, ????? ?????????? ?????? ?????????????? ??????????????? ?????????
????? ????????? ??????????? ??????? ??????? ? ???? ????? ?????????? ??????. ??? ??????????????? ????? ??????? ???????? (501— 50 ????), ????? ????? ????? ???????? ? ??????????? ??????? ????????? ? ???????????? ??????????? ????????? ????? ??????? ??????????? ???? ? ??????. ?????????????? ????? ? ???????? ???- ????????? ????? ?????? ? ????? ?????? ??????, ??????, ?????????????? ??????? ????????? ? ???????, ??????? ??????? ???? ??????? ??????? ? ???????? ??????? ????????? ?????? (? ????? ? ?????????? ??????). ? ????? ??????, ????, ??????? ????? ??????? ??????????????? ?????? ??????????, ? ??????? ????????? ?????- ????????????, ????????? ?????, ?????? ? ??????? ?? ???????????? ????????? ? ???????????? ????????? ??????????? ????????. ??????? ????, ??? ??????? ???????? ????? ????????? ?? ????????? ?????? ??- ???????????? ?????????, ??????????????, ? ??????? ? ?????? ??????, ??? ? ???- ????????? ???. ? ?????????????? ?????, ??? ? ? ?????? ??????????????, ?????? ????? ??? ????????? ????????. ?????? ?????????? ? ?????? ??????, ?????????? ????????? ????? ????????????- ??? ?????. ??? ??? ??????????????? ??????? ?????????? ????? ????-??????, ?? ???????? ?? ????????? ? ???????? ?????, ?????? ? ???? ???????? ?? ????? ??- ????? ????????? ?????? ??? ?????? ????????? ??????????? ?????????, ????????- ????? ? ??????. ? ????????????????? ????? ?????? ?????????????? ??????????, ????????, ????- ?????????? ?????????? ?????????? ? ???? ??????? ?????????????? ?????????? ??- ????????? ????, ??????? ??????????? ??????? ???????? ?????????? (??????? 25 ??) , ????? ???????? ?????????? ????????. ??? ??? ??????, ??? ? ????????????? ???????????????? ???????????? ??????? ? 50 ???? (? ?????????? ????????????? ?????????? ??????? ????? 15 ???, ? ????????? ??? ????), ?????????????, ????- ?????? ???????????, ??? ????????? ????, ? ??? ??????? ????? ?????????? ?????? ???????? (??????? ??? ????? ????????? ??? ? ??????? ??). ????????? ?????? ??????? ?? ??????????? ??????????????, ??????? ????? ????? ????????????? ??????? ????? ??? ??????? (??? ????????????? ? ???????), ?? ??? ???? ?? ??????????, ??? ??? ??????????? ????? ???????????? ?????????. ??? ??- ?? ?????????, ??????? ???????????? ??? ????????????? ?????????????? ?????, — ??? ??????? ????? ? ?????, ??????? ????? ??????? ?? ????? ???????? ????, ??? ??? ??? ?????? ?????????? ???????????? ??????? ?????? ????? ????. ??????????, ??????? ????? ???????? ??????? ???????????, ?????????? ???? ??????? ?????????? ???????. ?????????? ??? ??????? ?? ???? ?? ????????: ?? ????????, ??? ? ???? ???? ??????? ???????????? ??????, ??????? ????? ?? ???? ????????????, ?? ??????, ??? ?????? ????????. ????????? ????????? ???????????? ????????? ???????, ????? ?????????? ?????????, ??????? ????- ? ????? ? ???- ????? ??? ??????????? 8600 ? ? ?????? ????????? ????? ????? ?? ????. ?????? ?? ??????????. ???????? ??????????? ? ??? — ?????? ???? ???? ????? ??????? ???????????? ???? ????????, ?? ?? ????????? ??? ?? ??- ????? ??????. ? ????? ????? ?????????, ??? ? ???????? ?????? ??????? ????? ???????????? ????. ??? ???? ?????? ???????????????? ???????? ?? ?????????? ?? ???????- ??? ?????? ???????? ????????????? ?????, ? ????? ? ??????? ????? ?????? ?????? ???????? ?? ????? ?????????????? ? ??????? ??????????????. ????? ???????, ???? ?? ???????????? ??????????? ?????? ????? ???????? ?????? ??- ??? ? ???????????????????. ? ????? ????, ? ???????? ?????? ?????????? ???????? ?????????? ?????, ???? — ???, ?????????? ??????????????? ?????????????? ??????????, ??????? ????? ???????? ? ??????????????? ??????. ??????? ??????? ??????????? ? ???, ??? ???? ?????????? ??????? ??????? ? ????????. ? ?? ????? ????? ????????, ??? ?????? ?????? ?? ?????? ??????? ??????, ?? ?
Search
Read the Text Version
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210
- 211
- 212
- 213
- 214
- 215
- 216
- 217
- 218
- 219
- 220
- 221
- 222
- 223
- 224
- 225
- 226
- 227
- 228
- 229
- 230
- 231
- 232
- 233
- 234
- 235
- 236
- 237
- 238
- 239
- 240
- 241
- 242
- 243
- 244
- 245
- 246
- 247
- 248
- 249
- 250
- 251
- 252
- 253
- 254
- 255
- 256
- 257
- 258
- 259
- 260
- 261
- 262
- 263
- 264
- 265
- 266
- 267
- 268
- 269
- 270
- 271
- 272
- 273
- 274
- 275
- 276
- 277
- 278
- 279
- 280
- 281
- 282
- 283
- 284
- 285
- 286
- 287
- 288
- 289
- 290
- 291
- 292
- 293
- 294
- 295
- 296
- 297
- 298
- 299
- 300
- 301
- 302
- 303
- 304
- 305
- 306
- 307
- 308
- 309
- 310
- 311
- 312
- 313
- 314
- 315
- 316
- 317
- 318
- 319
- 320
- 321
- 322
- 323
- 324
- 325
- 326
- 327
- 328
- 329
- 330
- 331
- 332
- 333
- 334
- 335
- 336
- 337
- 338
- 339
- 340
- 341
- 342
- 343
- 344
- 345
- 346
- 347
- 348
- 349
- 350
- 351
- 352
- 353
- 354
- 355
- 356
- 357
- 358
- 359
- 360
- 361
- 362
- 363
- 364
- 365
- 366
- 367
- 368
- 369
- 370
- 371
- 372
- 373
- 374
- 375
- 376
- 377
- 378
- 379
- 380
- 381
- 382
- 383
- 384
- 385
- 386
- 387
- 388
- 389
- 390
- 391
- 392
- 393
- 394
- 395
- 396
- 397
- 398
- 399
- 400
- 401
- 402
- 403
- 404
- 405
- 406
- 407
- 408
- 409
- 410
- 411
- 412
- 413
- 414
- 415
- 416
- 417
- 418
- 419
- 420
- 421
- 422
- 423
- 424
- 425
- 426
- 427
- 428
- 429
- 430
- 431
- 432
- 433
- 434
- 435
- 436
- 437
- 438
- 439
- 440
- 441
- 442
- 443
- 444
- 445
- 446
- 447
- 448
- 449
- 450
- 451
- 452
- 453
- 454
- 455
- 456
- 457
- 458
- 459
- 460
- 461
- 462
- 463
- 464
- 465
- 466
- 467
- 468
- 469
- 470
- 471
- 472
- 473
- 474
- 475
- 476
- 477
- 478
- 479
- 480
- 481
- 482
- 483
- 484
- 485
- 486
- 487
- 488
- 489
- 490
- 491
- 492
- 493
- 494
- 495
- 496
- 497
- 498
- 499
- 500
- 501
- 502
- 503
- 504
- 505
- 506
- 507
- 508
- 509
- 510
- 511
- 512
- 513
- 514
- 515
- 516
- 517
- 518
- 519
- 520
- 521
- 522
- 523
- 524
- 525
- 526
- 527
- 528
- 529
- 530
- 531
- 532
- 533
- 534
- 535
- 536
- 537
- 538
- 539
- 540
- 541
- 542
- 543
- 544
- 545
- 546
- 547
- 548
- 549
- 550
- 551
- 552
- 553
- 554
- 555
- 556
- 557
- 558
- 559
- 560
- 561
- 562
- 563
- 564
- 565
- 566
- 567
- 568
- 569
- 570
- 571
- 572
- 573
- 574
- 575
- 576
- 577
- 578
- 579
- 580
- 581
- 582
- 583
- 584
- 585
- 586
- 587
- 588
- 589
- 590
- 591
- 592
- 593
- 594
- 595
- 596
- 597
- 598
- 599
- 600
- 601
- 602
- 603
- 604
- 605
- 606
- 607
- 608
- 609
- 610
- 611
- 612
- 613
- 614
- 615
- 616
- 617
- 618
- 619
- 620
- 621
- 622
- 623
- 624
- 625
- 626
- 627
- 628
- 629
- 1 - 50
- 51 - 100
- 101 - 150
- 151 - 200
- 201 - 250
- 251 - 300
- 301 - 350
- 351 - 400
- 401 - 450
- 451 - 500
- 501 - 550
- 551 - 600
- 601 - 629
Pages: