This library is based on: https://github.com/wonho-maker/Adafruit_SH1106
It is very similar to rAdafruitSSD1306 library: https://www.b4x.com/android/forum/threads/radafruitssd1306-oled-displays.68906/ (without the scrolling methods).
It depends on rAdafruitGFX library: https://www.b4x.com/android/forum/threads/68904/#content
Example:
It is very similar to rAdafruitSSD1306 library: https://www.b4x.com/android/forum/threads/radafruitssd1306-oled-displays.68906/ (without the scrolling methods).
It depends on rAdafruitGFX library: https://www.b4x.com/android/forum/threads/68904/#content
Example:
B4X:
Sub Process_Globals
Public Serial1 As Serial
Private ssd As AdafruitSH1106
Private vx = 3, vy = 3 As Int
Private px, py As Int
Private radius As Int = 3
Private tmr As Timer
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
ssd.InitializeI2C(4, 0x3c)
ssd.ClearDisplay
tmr.Initialize("tmr_Tick", 10)
tmr.Enabled = True
End Sub
Private Sub tmr_Tick
ssd.GFX.DrawCircle(px, py, radius, ssd.BLACK, True)
px = px + vx
py = py + vy
If px - radius <= 0 Then vx = Abs(vx)
If px + radius >= ssd.GFX.Width Then vx = -Abs(vx)
If py - radius <= 0 Then vy = Abs(vy)
If py + radius >= ssd.GFX.Height Then vy = -Abs(vy)
ssd.GFX.DrawCircle(px, py, radius, ssd.WHITE, True)
ssd.Display 'apply the drawings
End Sub