B4R Question Timer / LCD Issue with ESP32

John Naylor

Active Member
Licensed User
Hey all I'm struggling with a Heltec Wifi kit 32 (the variety with a small LCD screen piggy backed on to the board).

I draw to the screen using inline C - this works fine until I start any other timers.

in AppStart...

B4X:
    LDR_Read_Timer.Initialize("LDR_Read_Timer_Tick",50)
    LDR_Read_Timer.Enabled = False
   
    Rotate_Timer.Initialize("Rotation_Timer_Tick",50)
    Rotate_Timer.Enabled=False
   
    StopWatch_Timer.Initialize("Stopwatch_Timer_Tick",10)
    StopWatch_Timer.Enabled=False
   
    Screen_Timer.Initialize("Screentimer_Tick", 1500)
    Screen_Timer.Enabled = False

    Delay (10)                            'Without this delay we cannot get past the next     RunNative ("setup",Null)   command. I can live with that.

    Log ("Running Setup")
    RunNative ("setup",Null)
   
    Log ("Running drawNTD started")
    RunNative ("drawNTD",Null)

    Log ("Starting 'Waiting for' screen")
    Screen_Timer.Enabled=True
   
    Delay (8000)                    'Enough time to see that the screen is displayed correctly which it is
    Log ("Enabling LDR Timer to test for screen corruption")
    LDR_Read_Timer.Enabled=True        'At this point the screen corrupts

The Screen_Timer simply rotates through 3 different screens, updating every 1.5 seconds to produce a text animation.

Am I simply asking too much of this ESP32? I could happily do away with the animation to be fair, I'm just intrigued.
 

thetahsk

Active Member
Licensed User

The Heltec Wifi kit 32 board uses an SSD1306 display. You can use the rAdafruitSSD1306 lib from Erel.

Only a simple adaption is required. See the diagram for details.
1612448818012.png



...and post the entire code of your project to see what happens
 
Upvote 0
Top