New to Arduino but until today no problems. Have lilygo t display s3. Below is the file I have been working on, was running perfectly earlier, installed TFT_eWidget and I am now getting a communication error when I attempt to upload.
Screen is now blacked out so I know some communication has happened but received the following message and just cant figure out what has changed. I am sure its something simple.
"A serial exception error occurred: Write timeout
Note: This error originates from pySerial. It is likely not a problem with esptool, but with the hardware connection or drivers.
For troubleshooting steps visit: Troubleshooting - ESP32 - — esptool.py latest documentation
Failed uploading: uploading error: exit status 1"
//FUEL AND OIL
//320x170
//LILYGO T DISPLAY S3
//MAKE SURE ESP IS VERSION LOWER THAN 3.0
//analog in pin 1, 2 for esp32-S3
#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();
TFT_eSprite sprite = TFT_eSprite(&tft);
TFT_eSprite img = TFT_eSprite(&tft);
#define color1 0xff9e //almost white
#define color2 0x39e7 //almost black
#define color3 0xf800 //red-ish
#define color4 0x3fe7 //green 0x3fe7 0x1de3
#define color5 0x39c7 //grey
int values[2] = { 0 };
void setup() {
// initialize serial communication at 9600 bits per second:
//Serial.begin(9600);
tft.init();
tft.setRotation(3);
sprite.createSprite(320, 170);
sprite.fillSprite(color1);
}
void drawGraph() {
//oil label
sprite.fillRoundRect(10, 20, 82, 54, 6, color5); //1st bar oil label bckgrd
sprite.setTextSize(3);
sprite.setTextColor(TFT_RED);
sprite.drawString("OIL", 20, 36, 1);
//fuel label
sprite.fillRoundRect(10, 96, 82, 54, 6, color5); //2nd bar oil label bckgrd
sprite.setTextSize(3);
sprite.setTextColor(TFT_RED);
sprite.drawString("FUEL", 16, 112, 1);
sprite.pushSprite(0, 0); //goes at end just before loop
}
// the loop routine runs over and over again forever:
void loop() {
drawGraph();
//OIL GAUGE
//this reads pin 2, remaps 0-100, prnts mapped value to serial print
int sensorValue = analogRead(2); // read the input on analog pin 34:
int mappedVal = map(analogRead(2), 0, 4095, 0, 200); // scale the value
//oil bar graph bkgrd
sprite.fillRoundRect(100, 20, 210, 54, 5, color2); // 1st bar graph bkgrd oil (frm left,frm top,length,hght,rad)
//oil bar graph slider
sprite.setCursor(104, 10);
sprite.fillRoundRect(104, 26, mappedVal, 42, 5, color4); //Draw a rectangle (x,y,width,height,color)
// FUEL GAUGE
//this reads pin 3
int fuelValue = analogRead(3);
int fuelVal = map(analogRead(3), 0, 4095, 0, 200); // scale the value
//fuel bar bkgrd
sprite.fillRoundRect(100, 96, 210, 54, 5, color2); //2nd bar graph bkgrd(frm left,frm top,length,hght,rad)
//fuelbar graph slider
sprite.fillRoundRect(104, 102, fuelVal, 42, 5, color4); //2nd bar graph (frm left,frm top,length,hght,rad)
sprite.setCursor(104, 100);
Serial.println(mappedVal); // print out the value:
delay(1); // delay in between reads for stability