B4R Question SSD1306 OLED Display showing only white dots

giggetto71

Active Member
Licensed User
Longtime 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:
B4X:
#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(0, 0)
    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!
 
Top