B4R Question SSD1306 OLED Display showing only white dots

Discussion in 'B4R Questions' started by giggetto71, May 17, 2019.

  1. giggetto71

    giggetto71 Member Licensed User

    Guys,
    I following this example to get the rAdafruitSSD1306 - OLED displays working with a wemos D1 mini.

    https://www.b4x.com/android/forum/threads/radafruitssd1306-oled-displays.68906/

    I know that the device is wired properly, I2C wise, as I can scan the I2C address fine (0x3C). I have simplified the Clock example from the thread above which now looks like:
    Code:
    #AutoFlushLogs: True
    #CheckArrayBounds: True
    'set the stack buffer size!
    #StackBufferSize: 600

    Sub Process_Globals
        
    Public Serial1 As Serial
        
    Private clock As Timer
        
    Private ssd As AdafruitSSD1306
        
    Private d1pins As D1Pins   
    End Sub

    Private Sub AppStart
        Serial1.Initialize(
    115200)
        
    Log("AppStart")
        clock.Initialize(
    "clock_Tick"5000)
        ssd.InitializeI2C(d1pins.D6, 
    0x3c)
        ssd.ClearDisplay
    End Sub

    Public Sub TimeIsAvailable
        clock.Enabled = 
    True
    End Sub

    Private Sub Clock_Tick
        ssd.ClearDisplay
        ssd.GFX.SetCursor(
    00)
        ssd.GFX.ConfigureText(
    1, ssd.WHITE, False)  
        ssd.GFX.DrawText(
    "Date: ").DrawText("14/05").DrawText(CRLF).DrawText(CRLF)
        ssd.Display
    End Sub

    Unfortunately the only result I could get is the screen displaying several (hundreds) white dots randonly placed. I have also replaced the device as I thought the first was just broken but the new one I got today behaves the same way..
    Am I missing something ?
    thanks!
     
  2. thetahsk

    thetahsk Active Member Licensed User

    You must enable your Timer. You never call the TimeIsAvailable function.
     
    giggetto71 likes this.
  3. giggetto71

    giggetto71 Member Licensed User

    ahhhhrg...you are sooo right thetahsk!
    I feel dumb...thanks!!!now it works as expected!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice