B4R Library TM1637 - 4 digits display

Discussion in 'B4R Libraries' started by Erel, Jun 9, 2016.

  1. Erel

    Erel Administrator Staff Member Licensed User

    [​IMG]

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

    Timer example:
    Code:
    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(
    23)
       timer1.Initialize(
    "timer1_Tick"1000)
       timer1.Enabled = 
    True
    End Sub

    Sub Timer1_Tick
       tm.ShowNumberDec2(Millis / 
    1000True40)
    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
     

    Attached Files:

    Last edited: Jan 15, 2017
  2. Erel

    Erel Administrator Staff Member Licensed User

    Library updated to v1.10. It allows controlling the decimal dots or colons.

    The dots are controlled by a bit mask.
    Pass 0xFF to enable all dots / colons.

    Code:
    tm.ShowNumberDec3(Millis / 1000True400xFF)
     
    Peter Simpson likes this.
  3. rwblinn

    rwblinn Well-Known Member Licensed User

    Library updated to v1.20.
    It allows to set the display brightness or turn the display on / off.

    Code:
    ' 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)
     

    Attached Files:

    Peter Simpson and Erel like this.
Loading...