diff --git a/usermods/TTGO-T-Display/README.md b/usermods/TTGO-T-Display/README.md index 5674c466..872beeb8 100644 --- a/usermods/TTGO-T-Display/README.md +++ b/usermods/TTGO-T-Display/README.md @@ -3,14 +3,24 @@ This usermod allows use of the TTGO T-Display ESP32 module with integrated 240x1 for controlling WLED and showing the following information: * Current SSID * IP address if obtained - * in AP mode and turned off lightning AP password is shown + * If connected to a network, current brightness % is shown + * in AP mode AP IP and password are shown * Current effect * Current palette +* Estimated current in mA is shown (NOTE: for this to be a reasonable value, the correct LED type must be specified in the LED Prefs section) + +Button pin is mapped to the onboard button next to the side actuated reset button of the TTGO T-Display board. + +I have designed a 3D printed case around this board and an ["ElectroCookie"](https://amzn.to/2WCNeeA) project board, a [level shifter](https://amzn.to/3hbKu18), a [buck regulator](https://amzn.to/3mLMy0W), and a DC [power jack](https://amzn.to/3phj9NZ). I use 12V WS2815 LED strips for my projects, and power them with 12V power supplies, so the regulator drops the voltage to the 5V level I need to power the ESP module and the level shifter. If there is any interest in this case, which elevates the board and display on some custom extended headers to make place the screen at the top of the enclosure (with accessible buttons), let me know, and I could post the STL files. It is a bit tricky to get the height correct, so I also designed a one-time use 3D printed solder fixture to set the board in the right location and at the correct height for the housing. (It is one-time use because it has to be cut off after soldering to be able to remove it). I didn't think the effort to make it in multiple pieces was worthwhile. Usermod based on a rework of the ssd1306_i2c_oled_u8g2 usermod from the WLED repo. ## Hardware ![Hardware](assets/ttgo_hardware1.png) +![Hardware](assets/ttgo-tdisplay-enclosure1a.png) +![Hardware](assets/ttgo-tdisplay-enclosure2a.png) +![Hardware](assets/ttgo-tdisplay-enclosure3a.png) +![Hardware](assets/ttgo-tdisplay-enclosure3a.png) ## Github reference for TTGO-Tdisplay @@ -20,7 +30,11 @@ Usermod based on a rework of the ssd1306_i2c_oled_u8g2 usermod from the WLED rep Functionality checked with: * TTGO T-Display * PlatformIO -* Group of 4 individual Neopixels from Adafruit, and a full string of 68 LEDs. +* Group of 4 individual Neopixels from Adafruit, and a several full strings of 12v WS2815 LEDs. +* The hardware design shown above should be limited to shorter strings. For larger strings, I use a different setup with a dedicated 12v power supply and power them directly off the supply (in addition to dropping the 12v supply down to 5v with a buck regulator for the ESP module and level shifter). + +## Setup Needed: +* As with all usermods, copy the usermod.cpp file from the TTGO-T-Display usermod folder to the wled00 folder (replacing the default usermod.cpp file). ## Platformio Requirements ### Platformio.ini changes diff --git a/usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure1a.png b/usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure1a.png new file mode 100644 index 00000000..5c2c2bef Binary files /dev/null and b/usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure1a.png differ diff --git a/usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure2a.png b/usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure2a.png new file mode 100644 index 00000000..ac76ade4 Binary files /dev/null and b/usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure2a.png differ diff --git a/usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure3a.png b/usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure3a.png new file mode 100644 index 00000000..21c416f7 Binary files /dev/null and b/usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure3a.png differ diff --git a/usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure4a.png b/usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure4a.png new file mode 100644 index 00000000..a098fc23 Binary files /dev/null and b/usermods/TTGO-T-Display/assets/ttgo-tdisplay-enclosure4a.png differ diff --git a/usermods/TTGO-T-Display/usermod.cpp b/usermods/TTGO-T-Display/usermod.cpp index a4bb28c8..75e90b1e 100644 --- a/usermods/TTGO-T-Display/usermod.cpp +++ b/usermods/TTGO-T-Display/usermod.cpp @@ -56,7 +56,7 @@ void userSetup() { tft.setTextColor(TFT_WHITE); tft.setCursor(1, 10); tft.setTextDatum(MC_DATUM); - tft.setTextSize(2); + tft.setTextSize(3); tft.print("Loading..."); if (TFT_BL > 0) { // TFT_BL has been set in the TFT_eSPI library in the User Setup file TTGO_T_Display.h @@ -142,22 +142,41 @@ void userLoop() { tft.fillScreen(TFT_BLACK); tft.setTextSize(2); // First row with Wifi name - tft.setCursor(1, 10); + tft.setCursor(1, 1); tft.print(knownSsid.substring(0, tftcharwidth > 1 ? tftcharwidth - 1 : 0)); // Print `~` char to indicate that SSID is longer, than our dicplay if (knownSsid.length() > tftcharwidth) tft.print("~"); - // Second row with IP or Psssword - tft.setCursor(1, 40); - // Print password in AP mode and if led is OFF. - if (apActive && bri == 0) - tft.print(apPass); - else + // Second row with AP IP and Password or IP + tft.setTextSize(2); + tft.setCursor(1, 24); + // Print AP IP and password in AP mode or knownIP if AP not active. + // if (apActive && bri == 0) + // tft.print(apPass); + // else + // tft.print(knownIp); + + if (apActive) { + tft.print("AP IP: "); tft.print(knownIp); + tft.setCursor(1,46); + tft.print("AP Pass:"); + tft.print(apPass); + } + else { + tft.print("IP: "); + tft.print(knownIp); + tft.setCursor(1,46); + //tft.print("Signal Strength: "); + //tft.print(i.wifi.signal); + tft.print("Brightness: "); + tft.print(((float(bri)/255)*100)); + tft.print("%"); + } // Third row with mode name - tft.setCursor(1, 70); + tft.setCursor(1, 68); uint8_t qComma = 0; bool insideQuotes = false; uint8_t printedChars = 0; @@ -184,7 +203,7 @@ void userLoop() { break; } // Fourth row with palette name - tft.setCursor(1, 100); + tft.setCursor(1, 90); qComma = 0; insideQuotes = false; printedChars = 0; @@ -210,5 +229,10 @@ void userLoop() { if ((qComma > knownPalette) || (printedChars > tftcharwidth - 1)) break; } - -} \ No newline at end of file + // Fifth row with estimated mA usage + tft.setCursor(1, 112); + // Print estimated milliamp usage (must specify the LED type in LED prefs for this to be a reasonable estimate). + tft.print(strip.currentMilliamps); + tft.print("mA (estimated)"); + +}