-
Arduino code for the ESP
06/28/2017 at 10:08 • 0 comments(OTA doesn't work with current chip)
#include <ESP8266WiFi.h> #include <ESP8266mDNS.h> #include <WiFiUdp.h> #include <ArduinoOTA.h> #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd[8] = { LiquidCrystal_I2C(0x27, 16, 2), LiquidCrystal_I2C(0x26, 16, 2), LiquidCrystal_I2C(0x25, 16, 2), LiquidCrystal_I2C(0x24, 16, 2), LiquidCrystal_I2C(0x23, 16, 2), LiquidCrystal_I2C(0x22, 16, 2), LiquidCrystal_I2C(0x21, 16, 2), LiquidCrystal_I2C(0x20, 16, 2) }; int LED = 0; int sda = 4; int scl = 5; int current_lcd = 0; int current_lcd_line = 0; const char* ssid = "XXX"; const char* password = "XXX"; const char* clientID = "octoLCD"; const char* host = "your.hostname.com"; void setup() { Serial.begin(115200); Serial.println("Booting"); Wire.begin(sda, scl); for (int i=0; i<8; i++) { lcd[i].init(); } for (int i=0; i<8; i++) { lcd[i].backlight(); } setup_wifi(); // Hostname defaults to esp8266-[ChipID] ArduinoOTA.setHostname(clientID); // No authentication by default ArduinoOTA.setPassword((const char *)"PASSWORD"); ArduinoOTA.onStart([]() { Serial.println("Start"); }); ArduinoOTA.onEnd([]() { Serial.println("\nEnd"); }); ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) { Serial.printf("Progress: %u%%\r", (progress / (total / 100))); }); ArduinoOTA.onError([](ota_error_t error) { Serial.printf("Error[%u]: ", error); if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed"); else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed"); else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed"); else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed"); else if (error == OTA_END_ERROR) Serial.println("End Failed"); }); ArduinoOTA.begin(); } void setup_wifi() { delay(10); // We start by connecting to a WiFi network Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); } void loop() { ArduinoOTA.handle(); WiFiClient client; const int httpPort = 80; if (!client.connect(host, httpPort)) { Serial.println("connection failed"); return; } delay(10); String url = "/81602/index.php"; client.print(String("GET ") + url + " HTTP/1.1\r\n" + "Host: " + host + "\r\n" + "Connection: close\r\n\r\n"); delay(10); boolean ignore = true; reset_lcds(); while (client.connected()) { char a,b,c,d; if (!ignore) { String line = client.readStringUntil('\n'); // char f = (char) client.read(); Serial.println(line); draw(line); // lcd[0].print(a); // lcd[0].setCursor(0,0); } else { a = client.read(); if (a == 13) { b = client.read(); if (b == 10) { c = client.read(); if (c == 13) { d = client.read(); if (d == 10) { ignore = false; } } } } } } delay(15000); } void draw (String line) { lcd[current_lcd].print(line); if (current_lcd_line==1) { current_lcd_line = 0; if (current_lcd<7) current_lcd++; } else { lcd[current_lcd].setCursor(0,1); current_lcd_line = 1; } } void reset_lcds() { current_lcd = 0; current_lcd_line = 0; for (int i=0; i<8; i++) { lcd[i].clear(); } }
-
soooon
06/27/2017 at 21:40 • 0 commentsSo the data is served by a webpage, but it's still a mockup. But yay!
-
I'm a fire-ing my laser
06/24/2017 at 21:12 • 3 commentsnoooo.
-
So much for not soldering...
11/05/2016 at 17:05 • 0 commentsdamn, I might have killed one LCD in the process, but it looks nice, especially with the red power lights on the backside. I've hooked up one of my #Ignore this ESP8266 board s via I2C and used an LCD I2C library for arduinos. Almost too easy.
-
All boards soldered
10/13/2016 at 19:23 • 0 commentsNext up arduino and ic2 stuff. Muahaha.
[UPDATE]
Nopes, I'm just tooo lazy to solder a cable with pinheaders today, so I ordered these.
-
almost all parts are in
10/10/2016 at 07:21 • 2 comments8 LCDs and 5 I2C boards are in - muahahaha. Sooo.
Sorry for this short log.
-
mini rant
09/26/2016 at 08:46 • 0 commentsI really don't like the look of those 1602 LCDs.
They are ugly. So ugly.
Heavy and Bulky.
32 characters, not much at all.
5 displays for 1 tweet, even though I don't use twitter - this sucks.
The coolest I've seen done with it where special character animations and the eyes of Chappy.
-
I'm going for eight displays now
09/24/2016 at 16:13 • 3 commentsThere are 3 external address bits on the I2C controller boards and the displays are cheap, so why not have at least eight displays, instead of 5 or 24.