<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Boot-Problem: LilyGO TTGO-S3 Touch]]></title><description><![CDATA[<p dir="auto">Hello,<br />
depending on the place I am, I boot by</p>
<ul>
<li>PC-USB</li>
<li>Li-Ion-Accu</li>
<li>230V-Power supply for USB devices</li>
<li>USB-Powerbank<br />
The example "HotHead" works in all 4 cases.</li>
</ul>
<p dir="auto">My temperature sketch only runs on PC-USB-connector. I used the setup constellation from "HotHead":</p>
<p dir="auto">#define PIN_POWER_ON 15  // LCD and battery Power Enable<br />
#define PIN_LCD_BL 38    // BackLight enable pin (see Dimming.txt)</p>
<p dir="auto">void setup() {<br />
pinMode(PIN_POWER_ON, OUTPUT);  // triggers the LCD backlight<br />
pinMode(PIN_LCD_BL, OUTPUT);    // BackLight enable pin<br />
delay(100);<br />
digitalWrite(PIN_POWER_ON, HIGH);<br />
digitalWrite(PIN_LCD_BL, HIGH);<br />
...<br />
}</p>
]]></description><link>https://www.community.lilygo.cc/topic/703/boot-problem-lilygo-ttgo-s3-touch</link><generator>RSS for Node</generator><lastBuildDate>Sun, 17 May 2026 06:32:44 GMT</lastBuildDate><atom:link href="https://www.community.lilygo.cc/topic/703.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 03 Oct 2023 10:06:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Boot-Problem: LilyGO TTGO-S3 Touch on Sat, 21 Oct 2023 18:53:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://www.community.lilygo.cc/uid/1248">@dirk</a> Well, Dirk that sketch has 'a lot of moving parts'!<br />
My troubleshooting approach is run my HotHead sketch and see if it will run on battery.<br />
If 'yes' then we must assume that one of your many sensors are drawing too much current and lowering the Vinput.<br />
Can you measure the battery voltage with a meter as you unplug the USB and switch to battery. (This may require a push of the little black Reset button to restart it.<br />
-Terry</p>
]]></description><link>https://www.community.lilygo.cc/post/1293</link><guid isPermaLink="true">https://www.community.lilygo.cc/post/1293</guid><dc:creator><![CDATA[teastain2]]></dc:creator><pubDate>Sat, 21 Oct 2023 18:53:02 GMT</pubDate></item><item><title><![CDATA[Reply to Boot-Problem: LilyGO TTGO-S3 Touch on Sat, 21 Oct 2023 12:01:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://www.community.lilygo.cc/uid/612">@teastain2</a></p>
<p dir="auto">Hello  teastain2,</p>
<p dir="auto">Board: "esp32 by Espressif Systems Version 2.0.9 INSTALLED"</p>
<p dir="auto">The code is too long to submit. I deleted uncommented lines &amp; the loop!</p>
<p dir="auto">/*<br />
// Default color definitions<br />
#define TFT_BLACK       0x0000      //   0,   0,   0<br />
#define TFT_NAVY        0x000F      //   0,   0, 128<br />
#define TFT_DARKGREEN   0x03E0      //   0, 180,   0<br />
#define TFT_DARKCYAN    0x03EF      //   0, 128, 128<br />
#define TFT_MAROON      0x7800      // 128,   0,   0<br />
#define TFT_PURPLE      0x780F      // 128,   0, 128<br />
#define TFT_OLIVE       0x7BE0      // 128, 128,   0<br />
#define TFT_LIGHTGREY   0xD69A      // 211, 211, 211<br />
#define TFT_DARKGREY    0x7BEF      // 128, 128, 128<br />
#define TFT_BLUE        0x001F      //   0,   0, 255<br />
#define TFT_GREEN       0x07E0      //   0, 255,   0<br />
#define TFT_CYAN        0x07FF      //   0, 255, 255<br />
#define TFT_RED         0xF800      // 255,   0,   0<br />
#define TFT_MAGENTA     0xF81F      // 255,   0, 255<br />
#define TFT_YELLOW      0xFFE0      // 255, 255,   0<br />
#define TFT_WHITE       0xFFFF      // 255, 255, 255<br />
#define TFT_ORANGE      0xFDA0      // 255, 180,   0<br />
#define TFT_GREENYELLOW 0xB7E0      // 180, 255,   0<br />
#define TFT_PINK        0xFE19      // 255, 192, 203  //Lighter pink, was 0xFC9F<br />
#define TFT_BROWN       0x9A60      // 150,  75,   0<br />
#define TFT_GOLD        0xFEA0      // 255, 215,   0<br />
#define TFT_SILVER      0xC618      // 192, 192, 192<br />
#define TFT_SKYBLUE     0x867D      // 135, 206, 235<br />
#define TFT_VIOLET      0x915C      // 180,  46, 226<br />
*/</p>
<p dir="auto">// TTGO S3 R8 mit OnBoard ST7789 1,19inch LCD 170x320 mit MCP9808- / KY-001- / AHT10- / BME680- / AHT25- / DS18B20-Temperatursensor-Modul</p>
<p dir="auto">//************************************<br />
//* Achtung:<br />
//* Die Datei "User_Setup.h" aus "TFT_eSPI" wurde wie folgt geändert:<br />
//* #define ST7789_DRIVER</p>
<p dir="auto">//    Werkzeuge/Boardverwalter...: "esp32 by Espressif Systems Version 2.0.9 INSTALLED"<br />
// Näheres siehe "ESP32-error 'rtc_gpio_desc' was not declared in this scope.doc"<br />
//************************************<br />
/*</p>
<ul>
<li>Angegeben sind nur die Änderungen zur Standardkonfiguration, Näheres steht im Dokument (s. u.):</li>
</ul>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align:left">Setting</th>
<th style="text-align:left">Value</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">Board</td>
<td style="text-align:left">ESP32S3 Dev Module</td>
</tr>
<tr>
<td style="text-align:left">USB Firmware MSC On Boot</td>
<td style="text-align:left">Disabled</td>
</tr>
<tr>
<td style="text-align:left">Flash Mode</td>
<td style="text-align:left">QIO 80MHz</td>
</tr>
<tr>
<td style="text-align:left">Flash Size</td>
<td style="text-align:left">16MB (128Mb)</td>
</tr>
<tr>
<td style="text-align:left">Events Run On</td>
<td style="text-align:left">Core 1</td>
</tr>
<tr>
<td style="text-align:left">Partition Scheme</td>
<td style="text-align:left">Huge APP (3MB No OTA/1MB SPIFFS)</td>
</tr>
<tr>
<td style="text-align:left">Erase All Flash Before...</td>
<td style="text-align:left">Disabled</td>
</tr>
<tr>
<td style="text-align:left">USB Mode</td>
<td style="text-align:left">Hardware CDC and JTAG</td>
</tr>
<tr>
<td style="text-align:left">Arduino Runs On</td>
<td style="text-align:left">Core 1</td>
</tr>
<tr>
<td style="text-align:left">JTAG Adapter</td>
<td style="text-align:left">Integrated USB JTAG</td>
</tr>
<tr>
<td style="text-align:left">CPU Frequency</td>
<td style="text-align:left">240MHz (WiFi)</td>
</tr>
<tr>
<td style="text-align:left">PSRAM</td>
<td style="text-align:left">OPI PSRAM</td>
</tr>
<tr>
<td style="text-align:left">USB CDC On Boot</td>
<td style="text-align:left">Enabled</td>
</tr>
<tr>
<td style="text-align:left">Upload Mode</td>
<td style="text-align:left">UART0 / Hardware CDC</td>
</tr>
<tr>
<td style="text-align:left">Upload Speed</td>
<td style="text-align:left">921600</td>
</tr>
<tr>
<td style="text-align:left">Core Debug Level</td>
<td style="text-align:left">None</td>
</tr>
<tr>
<td style="text-align:left">USB DFU On Boot</td>
<td style="text-align:left">Enabled (Requires USB-OTG Mode)</td>
</tr>
</tbody>
</table>
<p dir="auto">*/<br />
// Achtung: Auf die Board-Parameter achten -&gt; "ESP32-TTGO S3 ESP-32, ST7789 LCD 170x320 anschließen &amp; Boardparameter.doc"!<br />
// Klappt: Werte für Testversion:<br />
// "ESP32S3 Dev Module": 352493 Bytes (11%) des Programm-RAMs. Globale Variablen: 22040 Bytes (6%) des dynamischen Speichers</p>
<p dir="auto">//******* Initialisierungen ******<br />
// Für den MCP9808<br />
#include &lt;Wire.h&gt;<br />
#include "Adafruit_MCP9808.h"   // Adafruit_MCP9808_Library und Adafruit_BusIO-1.2.0<br />
// Create the MCP9808 temperature sensor object<br />
Adafruit_MCP9808 tempsensor = Adafruit_MCP9808();</p>
<p dir="auto">// Für das Display<br />
#define LeftButton         0<br />
#define RightButton       14<br />
#define PIN_POWER_ON      15<br />
#define PIN_LCD_BackLight 38<br />
#include &lt;TFT_eSPI.h&gt;           // TFT_eSPI-TTGO-S3<br />
#include &lt;SPI.h&gt;<br />
TFT_eSPI tft = TFT_eSPI();      // Invoke library, pins defined in User_Setup.h</p>
<p dir="auto">// Für den KY-001<br />
#include &lt;OneWire.h&gt;            // OneWire-master-2.3.7<br />
#include &lt;DallasTemperature.h&gt;  // Arduino-Temperature-Control-Library-master<br />
// Hier wird der Eingangspin deklariert, an den das Sensormodul angeschlossen wird<br />
#define KY001_Signal_PIN 2<br />
// Bibliotheken werden konfiguriert<br />
OneWire oneWire(2);     // An Pin 2 vom TTGO<br />
DallasTemperature sensors(&amp;oneWire);</p>
<p dir="auto">// Für den AHT10<br />
#include &lt;AHTxx.h&gt;    //  "AHTxx-main" aus "AHTxx-main (ASAIR).zip"<br />
AHTxx aht10(AHT10_ADDRESS_X39, AHT1x_SENSOR);  //sensor address, sensor type</p>
<p dir="auto">// Für den BME680<br />
#include &lt;Adafruit_Sensor.h&gt;  // Adafruit_Sensor-master<br />
#include "Adafruit_BME680.h"  // Adafruit_BME680-master</p>
<p dir="auto">#define BME_SCK  13<br />
#define BME_MISO 12<br />
#define BME_MOSI 11<br />
#define BME_CS   10<br />
#define SEALEVELPRESSURE_HPA (1013.25)<br />
Adafruit_BME680 bme; // I2C 0x77</p>
<p dir="auto">// Für den AHT25<br />
// #include &lt;AHTxx.h&gt;    //  "AHTxx-main" aus "AHTxx-main (ASAIR).zip", siehe "Für den AHT10"<br />
AHTxx aht25(AHTXX_ADDRESS_X38, AHT2x_SENSOR);  //sensor address, sensor type</p>
<p dir="auto">// Für den DS18B20, entspricht dem KY-001 und dessen Libraries<br />
// Hier wird kein Eingangspin deklariert, die Sensoren werden per Software abgefragt.</p>
<p dir="auto">// Für den BMP280<br />
#include &lt;Arduino.h&gt;<br />
#include &lt;Wire.h&gt;<br />
#include &lt;BMx280I2C.h&gt;    //  BMx280MI</p>
<p dir="auto">//create a BMx280I2C object using the I2C interface with I2C Address 0x76<br />
BMx280I2C BMP280(0x76);</p>
<p dir="auto">// Für den INA226<br />
// #include &lt;Wire.h&gt;    //  Bereits eingebunden</p>
<p dir="auto">// Für die Batterie-Anzeige:<br />
#define BATT_X                0      // X coordinate for battery message/indicator<br />
#define BATT_Y              208      // Y coordinate for battery message/indicator<br />
#define BATT_W               90      // width  of battery indicator<br />
#define BATT_H               19      // height of battery indicator<br />
#define BattV_LOW             3.3    // voltage considered to be low battery<br />
#define BATTV_MAX             4.1    // maximum voltage of battery<br />
#define BATTV_MIN             3.2    // what we regard as an empty battery<br />
#define BATT_ALERT_THRESHOLD  2      // how many times we read low battery before sending alert<br />
#define BATT_INTERVAL         1      // No. times through loop between battery readings<br />
#define SummerPin            13      // Pin für Summer<br />
#define DarkRED             0xA800         // Rot     810nm<br />
#define BattV_Ok_color      TFT_CYAN       // BatterieSpannung Ok<br />
#define BattV_75_color      TFT_GREEN      // BatterieSpannung unter 75%<br />
#define BattV_50_color      TFT_YELLOW     // BatterieSpannung unter 50%<br />
#define BattV_40_color      TFT_ORANGE     // BatterieSpannung unter 40%<br />
#define BattV_30_color      TFT_RED        // BatterieSpannung unter 30%<br />
#define BattV_20_color      DarkRED        // BatterieSpannung unter 20%<br />
#define Temperatur_color    TFT_ORANGE     //<br />
#define Feuchte_color       TFT_GREENYELLOW<br />
#define LuftDruck_color     TFT_SKYBLUE     //</p>
<p dir="auto">String  Version   = "09g";<br />
int     dx1       =  58;  // x-Position für die ":"-Ausgabe auf Display<br />
int     dx2       =  70;  // x-Position für die Datenausgabe auf Display<br />
int     dx3       = 140;  // x-Position für die Einheitenausgabe auf Display<br />
int     dx4       = 105;  // x-Position für die Messgenauigkeitsausgabe auf Display<br />
int     StartPosY =  16;  // Startzeile für die Datenausgabe auf Display<br />
int     FontNr    =   2;  // Nr. des verwendeten Fonts<br />
int     TextSize  =   1;  // Größe des verwendeten Fonts<br />
int     sensorCount;      // Anzahl der DS18B20- / KY-001-Sensoren<br />
int     Text2Hoehe;       // TextHoehe des Fonts 2<br />
uint8_t BattV_Prozent;    // battery level, in percentage<br />
uint8_t LowBattCounter;   // no. times we've seen a low battery<br />
bool    ButtonStatus;     // Flag, to show the right-/left-Botton Status<br />
bool    Display_On;       // Flag, Display is on<br />
bool    Testversion=false;// Testversion hat viele Ausgaben auf Ser. Monitor<br />
float   BatteryVolts;     // battery-Spannung in Volt<br />
float   BatteryAmps;      // battery level, in Ampere<br />
float   TTGO_Volts;       // TTGO-Spannung in Volt, ist wegen des StromShunts kleiner als BatteryVolts<br />
float   rShunt     = 0.1; // Shunt Widerstand festlegen, hier 0.1 Ohm<br />
float   Tmin  = 200;      // Extremwertspeicher, 200: Viel zu hohen Wert vorgeben<br />
float   Tmax  =-200;      // Extremwertspeicher<br />
float   rFmin = 100;      // Extremwertspeicher, 100: Viel zu hohen Wert vorgeben<br />
float   rFmax =   0;      // Extremwertspeicher<br />
long    StartMillis, Millis1, Millis2, Millis3, Millis4, Millis5, Millis6;      // Für Zeitmesungen<br />
long    Millis;           // Für Werteschleife<br />
long    MessWerteZaehler = 1;<br />
const int INA226_ADDR = 0x40; // A0 und A1 auf GND -&gt; Adresse 40 Hex; auf Seite 18 im Datenblatt</p>
<p dir="auto">void setup() {<br />
Serial.begin(9600);<br />
Wire.begin(43, 44);   // Ohne diese Festlegung funktioniert der I2C-Bus nicht!<br />
delay(200);           // Wichtig, damit nachfolgender Text ausgegeben wird.</p>
<p dir="auto">while (!Serial); //waits for serial terminal to be open, necessary in newer arduino boards.<br />
Serial.println("\nTemperaturmessung mit MCP9808, KY-001, AHT10, BME680, AHT25, DS18B20 und TTGO S3.");<br />
Serial.print("Version: ");     Serial.println(Version);</p>
<p dir="auto">// Display &amp; Button werden initialisiert<br />
Display_On = true;<br />
pinMode(PIN_POWER_ON,      OUTPUT);  // enables battery power and LCD backlight<br />
pinMode(PIN_LCD_BackLight, OUTPUT);  // controls the LCD backlight<br />
pinMode(LeftButton,        INPUT);   // Left  button pulled up, push = 0<br />
pinMode(RightButton,       INPUT);   // Right button pulled up, push = 0<br />
digitalWrite(PIN_POWER_ON, HIGH);    // Sonst funktioniert Betrieb über Batterie nicht!<br />
digitalWrite(PIN_LCD_BackLight, Display_On);</p>
<p dir="auto">tft.init();<br />
tft.setRotation(0);          // Hochformat<br />
tft.fillScreen(TFT_BLACK);   // Display löschen<br />
tft.setTextColor(TFT_WHITE, TFT_BLACK);<br />
tft.setCursor(  0, 0, 1);    // Font = 1<br />
tft.setTextSize(2);          tft.println("Wetterdaten");<br />
tft.setTextSize(1);          tft.setTextFont(FontNr);<br />
Text2Hoehe = tft.fontHeight(FontNr);      // FontNr = 2  --&gt; Text2Hoehe = 16, ist aber zu viel!<br />
Text2Hoehe = 13;</p>
<p dir="auto">tft.setTextColor(TFT_GREENYELLOW, TFT_BLACK);<br />
tft.setTextSize(1);<br />
tft.setCursor(0,310, 1);    tft.println("Right Button: Display on/off");<br />
tft.setCursor(0, 20, 1);    tft.println("Initialisierung:");<br />
tft.setTextColor(TFT_GREEN, TFT_BLACK);<br />
tft.setCursor(0, 30, 1);    tft.println("MCP9808:");</p>
<p dir="auto">// Sensor MCP9808 wird initialisiert<br />
// Make sure the sensor is found, you can also pass in a different i2c<br />
// address with tempsensor.begin(0x19) for example, also can be left in blank for default address use<br />
// Also there is a table with all addres possible for this sensor, you can connect multiple sensors<br />
// to the same i2c bus, just configure each sensor with a different address and define multiple objects for that<br />
//  A2 A1 A0 address<br />
//  0  0  0   0x18  this is the default address<br />
//  0  0  1   0x19<br />
//  0  1  0   0x1A<br />
//  0  1  1   0x1B<br />
//  1  0  0   0x1C<br />
//  1  0  1   0x1D<br />
//  1  1  0   0x1E<br />
//  1  1  1   0x1F<br />
if (!tempsensor.begin(0x18)) {<br />
<a href="//Serial.println">//Serial.println</a>("Couldn't find MCP9808! Check wiring &amp; address!");<br />
tft.setTextColor(TFT_RED, TFT_BLACK);<br />
tft.setCursor(50, 30, 1);    tft.println("Error");<br />
tft.setTextColor(TFT_GREEN, TFT_BLACK);<br />
//while (1);<br />
} else {<br />
tft.setCursor(50, 30, 1);    tft.println("Ok");<br />
}<br />
// Serial.println("Found MCP9808!");<br />
tempsensor.setResolution(3); // sets the resolution mode of reading, the modes are defined in the table bellow:<br />
// Mode Resolution SampleTime<br />
//  0    0.5°C       30 ms<br />
//  1    0.25°C      65 ms<br />
//  2    0.125°C     130 ms<br />
//  3    0.0625°C    250 ms</p>
<p dir="auto">// Sensor KY-001 wird initialisiert<br />
sensors.begin(); //Starten der Kommunikation mit dem Sensor<br />
//sensorCount = sensors.getDS18Count(); //Lesen der Anzahl der angeschlossenen Temperatursensoren.<br />
sensorCount = sensors.getDeviceCount(); //Lesen der Anzahl der angeschlossenen Temperatursensoren.</p>
<p dir="auto">// Sensor AHT10 wird initialisiert<br />
tft.setCursor(0, 40, 1);    tft.println("AHT10  :");<br />
if (aht10.begin() != true)  {<br />
<a href="//Serial.println">//Serial.println</a>(F("AHT10 not connected or fail to load calibration coefficient!")); //(F()) save string to flash &amp; keeps dynamic memory free<br />
tft.setTextColor(TFT_RED, TFT_BLACK);<br />
tft.setCursor(50, 40, 1);    tft.println("Error");<br />
tft.setTextColor(TFT_GREEN, TFT_BLACK);<br />
delay(1000);<br />
} else {<br />
<a href="//Serial.println">//Serial.println</a>(F("AHT10 OK"));<br />
tft.setCursor(50, 40, 1);    tft.println("Ok");<br />
}</p>
<p dir="auto">// Für den BME680<br />
tft.setCursor(0, 50, 1);    tft.println("BME680 :");<br />
<a href="//Serial.print">//Serial.print</a>(F("BME680 test: "));<br />
if (!bme.begin()) {<br />
<a href="//Serial.println">//Serial.println</a>("Could not find a valid BME680 sensor, check wiring &amp; address!");<br />
tft.setTextColor(TFT_RED, TFT_BLACK);<br />
tft.setCursor(50, 50, 1);    tft.println("Error");<br />
tft.setTextColor(TFT_GREEN, TFT_BLACK);<br />
//while (1);<br />
} else {<br />
<a href="//Serial.println">//Serial.println</a>(F("Found!"));<br />
tft.setCursor(50, 50, 1);    tft.println("Ok");<br />
}<br />
// Set up oversampling and filter initialization<br />
bme.setTemperatureOversampling(BME680_OS_8X);<br />
bme.setHumidityOversampling(BME680_OS_2X);<br />
bme.setPressureOversampling(BME680_OS_4X);<br />
bme.setIIRFilterSize(BME680_FILTER_SIZE_3);<br />
bme.setGasHeater(320, 150); // 320*C for 150 ms</p>
<p dir="auto">// Sensor AHT25 wird initialisiert<br />
tft.setCursor(0, 60, 1);    tft.println("AHT25  :");<br />
if (aht25.begin() != true)  {<br />
<a href="//Serial.println">//Serial.println</a>(F("AHT2x not connected or fail to load calibration coefficient!")); //(F()) save string to flash &amp; keeps dynamic memory free<br />
tft.setTextColor(TFT_RED, TFT_BLACK);<br />
tft.setCursor(50, 60, 1);    tft.println("Error");<br />
tft.setTextColor(TFT_GREEN, TFT_BLACK);<br />
delay(1000);<br />
} else {<br />
<a href="//Serial.println">//Serial.println</a>(F("AHT25 OK"));<br />
tft.setCursor(50, 60, 1);    tft.println("Ok");<br />
}</p>
<p dir="auto">// Für den BMP280<br />
tft.setCursor(0, 70, 1);    tft.println("BMP280 :");<br />
if (!BMP280.begin())  {<br />
<a href="//Serial.println">//Serial.println</a>("'begin()' failed. Check your BMP280 Interface and I2C Address.");<br />
tft.setTextColor(TFT_RED, TFT_BLACK);<br />
tft.setCursor(50, 70, 1);    tft.println("Error");<br />
tft.setTextColor(TFT_GREEN, TFT_BLACK);<br />
//while (1);<br />
} else {<br />
tft.setCursor(50, 70, 1);    tft.println("Ok");<br />
//if (BMP280.isBME280())  Serial.println("Sensor is a BME280");<br />
//else                    Serial.println("Sensor is a BMP280");<br />
tft.setCursor(10, 80, 1);<br />
if (BMP280.isBME280())  tft.println("Sensor is a BME280");<br />
else                    tft.println("Sensor is a BMP280");<br />
}</p>
<p dir="auto">//reset sensor to default parameters.<br />
BMP280.resetToDefaults();</p>
<p dir="auto">//by default sensing is disabled and must be enabled by setting a non-zero<br />
//oversampling setting.<br />
//set an oversampling setting for pressure and temperature measurements.<br />
BMP280.writeOversamplingPressure(BMx280MI::OSRS_P_x16);<br />
BMP280.writeOversamplingTemperature(BMx280MI::OSRS_T_x16);<br />
//if sensor is a BME280, set an oversampling setting for humidity measurements.<br />
if (BMP280.isBME280()) BMP280.writeOversamplingHumidity(BMx280MI::OSRS_H_x16);</p>
<p dir="auto">// INA226 wird initialisiert<br />
// Configuration Register Standard Einstellung 0x4127, hier aber 16 Werte Mitteln &gt; 0x4427<br />
// 0x4427 = 100 010 000 100 111<br />
// Bits  0- 2: Operating Mode:                111 = Shunt and Bus, Continuous<br />
// Bits  3– 5: Shunt Voltage Conversion Time: 100 = 1.1 ms<br />
// Bits  6– 8: Bus Voltage Conversion Time:   000 = 140 μs<br />
// Bits  9–11: Averaging Mode:                010 = 16 AVERAGES<br />
// Bits 12–14: Festgelegt:                    100<br />
writeRegister(0x00, 0x4427); // 1.1ms Volt und Strom A/D-Wandlung, Shunt und VBus continous</p>
<p dir="auto">tft.setTextColor(TFT_RED, TFT_BLACK);<br />
tft.setCursor(40,100, 1);    tft.println("Reading Sensors ...");<br />
delay(3000);    // Anzeige der Initialisierung abwarten<br />
//BatteryVolts = 3.4;  // Für Testzwecke<br />
} // Ende setup</p>
<p dir="auto">// ---------------------------------------------------------------------------------------<br />
// Funktion für den INA226<br />
static void writeRegister(byte reg, word value) {<br />
Wire.beginTransmission(INA226_ADDR);<br />
Wire.write(reg);<br />
Wire.write((value &gt;&gt; <img src="https://www.community.lilygo.cc/assets/plugins/nodebb-plugin-emoji/emoji/android/1f60e.png?v=5rta56507n5" class="not-responsive emoji emoji-android emoji--sunglasses" title="8)" alt="😎" /> &amp; 0xFF);<br />
Wire.write(value &amp; 0xFF);<br />
Wire.endTransmission();<br />
}</p>
<p dir="auto">// Funktion für den INA226<br />
static word readRegister(byte reg) {<br />
word res = 0x0000;<br />
Wire.beginTransmission(INA226_ADDR);<br />
Wire.write(reg);<br />
if (Wire.endTransmission() == 0) {<br />
if (Wire.requestFrom(INA226_ADDR, 2) &gt;= 2) {<br />
res = Wire.read() * 256;<br />
res += Wire.read();<br />
}<br />
}<br />
return res;<br />
}</p>
<p dir="auto">// ---------------------------------------------------------------------------------------<br />
void printBatteryLevel() {<br />
<a href="//Serial.println">//Serial.println</a>("printBatteryLevel()!!!!!!!!!!!!!");<br />
tft.setTextFont(FontNr);<br />
tft.setTextSize(1);<br />
tft.setCursor(BATT_X, BATT_Y);<br />
tft.fillRect(BATT_X, BATT_Y, TFT_WIDTH, BATT_H, TFT_BLACK);  // clear "Bar"<br />
if(BatteryVolts &gt; BattV_LOW) {<br />
// Draw outline box<br />
tft.drawRect(BATT_X, BATT_Y, BATT_W + 2, BATT_H, TFT_WHITE);<br />
// Draw the power level bar<br />
int Y2 = (BattV_Prozent * BATT_W)/100;<br />
switch (BattV_Prozent) {<br />
case   0 ...  19:    tft.fillRect(BATT_X + 1, BATT_Y + 1, Y2, BATT_H-2, BattV_20_color);   break;<br />
case  20 ...  29:    tft.fillRect(BATT_X + 1, BATT_Y + 1, Y2, BATT_H-2, BattV_30_color);   break;<br />
case  30 ...  39:    tft.fillRect(BATT_X + 1, BATT_Y + 1, Y2, BATT_H-2, BattV_40_color);   break;<br />
case  40 ...  49:    tft.fillRect(BATT_X + 1, BATT_Y + 1, Y2, BATT_H-2, BattV_50_color);   break;<br />
case  50 ...  74:    tft.fillRect(BATT_X + 1, BATT_Y + 1, Y2, BATT_H-2, BattV_75_color);   break;<br />
case  75 ... 100:    tft.fillRect(BATT_X + 1, BATT_Y + 1, Y2, BATT_H-2, BattV_Ok_color);   break;<br />
default:             tft.fillRect(BATT_X + 1, BATT_Y + 1, Y2, BATT_H-2, BattV_Ok_color);   break;<br />
}</p>
<pre><code>char buf[4];
sprintf(buf, "%i%%", BattV_Prozent);
tft.setTextColor(BattV_Ok_color);
if(BattV_Prozent &lt; 75) tft.setTextColor(BattV_75_color);
if(BattV_Prozent &lt; 50) tft.setTextColor(BattV_50_color);
if(BattV_Prozent &lt; 40) tft.setTextColor(BattV_40_color);
if(BattV_Prozent &lt; 30) tft.setTextColor(BattV_30_color);
if(BattV_Prozent &lt; 20) tft.setTextColor(BattV_20_color);
tft.setCursor(BATT_W + 20, BATT_Y - 0, 1);     // Font 1
tft.print(buf);             // "BattV_Prozent" rechts vom "Bar" ausgeben
LowBattCounter = 0;         // Reset
tft.setTextColor(TFT_MAGENTA);
tft.setCursor(3, BATT_Y + 6, 1);   tft.print(F("Battery-Level"));  // Font 1
</code></pre>
<p dir="auto">//  } else if(battv == 0) {<br />
//    /** Shows 0 when charging <strong>/<br />
//    low_batt_counter = 0;         // reset<br />
//    batt_warning_sent = false;    // reset<br />
//    tft.drawBitmap(BATT_X, BATT_Y, charge_symbol, CHARGE_SYMBOL_WIDTH, CHARGE_SYMBOL_HEIGHT, 1);<br />
} else {    /</strong> LOW BATTERY ! <strong>/<br />
Serial.println("</strong>** LOW BATTERY ! <strong><strong>");<br />
// we don't want to send a warning every time we arrive here because the reading could<br />
// be transient. So we insist on getting BATT_ALERT_THRESHOLD number of consecutive<br />
// warnings before sending an alert.<br />
LowBattCounter++;<br />
Serial.print("LowBattCount.2: ");  Serial.println(LowBattCounter);<br />
Serial.print("BattAlertThr.2: ");  Serial.println(BATT_ALERT_THRESHOLD);<br />
if(LowBattCounter &gt;= BATT_ALERT_THRESHOLD) {<br />
Serial.println("send an alert!</strong></strong>***************");<br />
// send an alert<br />
tone(SummerPin, 3000);       delay(500);      noTone(SummerPin);    // 500ms 3000Hz-Ton<br />
LowBattCounter = 0;<br />
}<br />
// tft.setCursor(5, BATT_Y - 2, 2);   tft.print(F("<em>Low Battery</em>"));<br />
// tft.setCursor(3, BATT_Y + 3, 1);   tft.print(F("<em>Low Battery</em>"));  // Font 1<br />
tft.setTextColor(TFT_RED, TFT_BLACK);<br />
tft.setCursor(3, BATT_Y + 6, 1);   tft.print(F("<em>Low Battery</em>"));  // Font 1<br />
// Draw outline box<br />
tft.drawRect(BATT_X, BATT_Y, BATT_W + 2, BATT_H, TFT_WHITE);<br />
}<br />
tft.setCursor(BATT_W + 20, BATT_Y +10, 1);     // Font 1<br />
tft.print(BatteryVolts, 2);   tft.print("V");  // "BatteryVolts" rechts vom "Bar" ausgeben<br />
} // Ende printBatteryLevel()</p>
]]></description><link>https://www.community.lilygo.cc/post/1292</link><guid isPermaLink="true">https://www.community.lilygo.cc/post/1292</guid><dc:creator><![CDATA[Dirk]]></dc:creator><pubDate>Sat, 21 Oct 2023 12:01:49 GMT</pubDate></item><item><title><![CDATA[Reply to Boot-Problem: LilyGO TTGO-S3 Touch on Sun, 08 Oct 2023 04:43:07 GMT]]></title><description><![CDATA[<p dir="auto">HotHead here!<br />
So, the HotHead sketch works on battery, yes?<br />
Could you post your temperature code here so I could run it on my LilyGO T-Display S3 ?<br />
-Terry</p>
]]></description><link>https://www.community.lilygo.cc/post/1241</link><guid isPermaLink="true">https://www.community.lilygo.cc/post/1241</guid><dc:creator><![CDATA[teastain2]]></dc:creator><pubDate>Sun, 08 Oct 2023 04:43:07 GMT</pubDate></item></channel></rss>