B4R Library TM1637 - 4 digits display

SS-2016-06-09_17.16.21.jpg


Based on this open source project: https://github.com/avishorp/TM1637

Timer example:
B4X:
Sub Process_Globals
   Public Serial1 As Serial
   Private tm As TM1637Display
   Private timer1 As Timer
End Sub

Private Sub AppStart
   Serial1.Initialize(115200)
   Log("AppStart")
   tm.Initialize(2, 3)
   timer1.Initialize("timer1_Tick", 1000)
   timer1.Enabled = True
End Sub

Sub Timer1_Tick
   tm.ShowNumberDec2(Millis / 1000, True, 4, 0)
End Sub

Connections:
CLK - 2 (can be changed)
DIO - 3 (can be changed)
VCC - 5v
GND - Ground

V1.20 (updated by rwblinn): https://www.b4x.com/android/forum/threads/tm1637-4-digits-display.67733/#post-477687
 

Attachments

  • rTM1637.zip
    6 KB · Views: 465
Last edited:

rwblinn

Well-Known Member
Licensed User
Library updated to v1.20.
It allows to set the display brightness or turn the display on / off.

B4X:
' Set the brightness between 0 (low) - 7 (high)
Private Brightness As Int = 3
tm.SetBrightness(Brightness, True)

' Turn the display OFF
tm.SetBrightness(Brightness, False)

' Turn the display ON
tm.SetBrightness(Brightness, True)
 

Attachments

  • rTM1637-1.2.zip
    6.6 KB · Views: 405
Top