B4R Question ILI9341 and ESP8266

Nizze

Active Member
Licensed User
Longtime User
With this part only

B4X:
Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart")
'    If STMP.Initialize(8, "STMP_Touch") = False Then
'        Log("Failed to initialize touch screen.")
'        Return
'    End If
    ILI.Initialize(2, 0)
    ILI.FillScreen(ILI.COLOR_GREEN)
    ILI.GFX.ConfigureText(2, ILI.COLOR_WHITE, True)
    ILI.GFX.SetCursor(2, 2)
    ILI.GFX.DrawText("This is a test")

End Sub

It sometimes boots up with my textline .
And sometimes it boots up with a blackscreen .

Its gonna be a long night ..

// Nizze
 
Upvote 0

thetahsk

Active Member
Licensed User
Longtime User
..turn on the background LED and wait 100ms. This code is from the esp8266-weather-station-color.ino file

B4X:
void setup() {
  Serial.begin(115200);
  WiFi.disconnect();

  // The LED pin needs to set HIGH
  // Use this pin to save energy
  // Turn on the background LED
  pinMode(TFT_LED, OUTPUT);

  #ifdef TFT_LED_LOW
    digitalWrite(TFT_LED, LOW);
  #else
    digitalWrite(TFT_LED, HIGH);    // HIGH to Turn on;
  #endif 
  delay(100);
 
  #define ILI9341_SWRESET 0x01
  tft.writecommand(ILI9341_SWRESET); 
  gfx.init();
  gfx.fillBuffer(MINI_BLACK);
  gfx.commit();

........
 
Upvote 0

Nizze

Active Member
Licensed User
Longtime User
Hi

Thanks for helping out !!
But i can not see where in my code the pause schould be .
I dont have any "TFT LED HIGH"

// Nizze
 
Upvote 0

Nizze

Active Member
Licensed User
Longtime User
After spending some hours ...
This works( Most of the times )

So now i need to find how to use button and touchscreen
Hav tryed , but no luck so far .
I'l be back on that ....


B4X:
    Init.Enabled = False
    Log("Init started")
    ILI.Initialize(15, 0)
    ILI.FillScreen(ILI.COLOR_BLACK)
    ILI.SetRotation(1)
    ILI.GFX.ConfigureText(2, ILI.COLOR_BLACK, True)
    ILI.GFX.SetCursor(2, 2)
    ILI.GFX.DrawText("     Testing  1")

    
    ILI.GFX.ConfigureText(2, ILI.COLOR_BLACK, True)
    ILI.GFX.SetCursor(2, 22)
    ILI.GFX.DrawText("   Waiting for connection ")
    If wifi.IsConnected Then
        Log("Starting server")
        server.Initialize(3000, "server_NewConnection")
        server.Listen
    
        Worktimer.Initialize("Worktimer_Tick",2000)
        Worktimer.Enabled = True
    End If
 
Upvote 0
Top