logo elektroda
logo elektroda
X
logo elektroda

TM1638 Driver Development Progress: Updates on Module, Code, and Integration Features

DeDaMrAz 1332 9
ADVERTISEMENT
  • ADVERTISEMENT
  • #2 20553637
    p.kaczmarek2
    Moderator Smart Home
    It seems that this TM1638 is using one segment per digit, see datasheet section:
    TM1638 Driver Development Progress: Updates on Module, Code, and Integration Features
    This is different from TM1637 I tested in the past, which was using one grid per digit:
    TM1638 Driver Development Progress: Updates on Module, Code, and Integration Features
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20553663
    DeDaMrAz
    Level 19  
    Build 1.17.34 and this command

    backlog TMGN_Clear; TMGN_SetBit 0 0 1 ;   TMGN_SetBit 0 1 1 ;  TMGN_SetBit 0 2 1  ; TMGN_SetBit 0 3 1


    returns this:

    TM1638 Driver Development Progress: Updates on Module, Code, and Integration Features

    Added after 20 [minutes]:

    Progress report with build 1.17.35:

    backlog TMGN_Print 0 0 1; TMGN_Print 1 0 2; TMGN_Print 2 0 3; TMGN_Print 3 0 4; TMGN_Print 4 0 5; TMGN_Print 5 0 6; TMGN_Print 6 0 7; TMGN_Print 7 0 8


    TM1638 Driver Development Progress: Updates on Module, Code, and Integration Features

    Also mapping works:

    TMGN_Map 7 6 5 4 3 2 1 0


    TM1638 Driver Development Progress: Updates on Module, Code, and Integration Features

    LED control is solved, now input switches ;)
  • ADVERTISEMENT
  • #4 20553698
    p.kaczmarek2
    Moderator Smart Home
    this commit:
    https://github.com/openshwprojects/OpenBK7231...mmit/48acf3c825b8a53b1d925eb846fba2e51bab74a3
    introduces a TM1638 driver wrapper.

    Right now, all TM1637, TM1638, and GN6932 should work through a single driver implementation, although so implementation details may be different from chip to chip.
    The TM1637 is I2C-like (but it's like a modified I2C standard, idk why manufacturer went that way)
    The GN6932 and TM1638 is SPI-like
    Helpful post? Buy me a coffee.
  • #5 20554121
    DeDaMrAz
    Level 19  
    Build 1.17.43 progress:

    Keys can now be read with TNMG_SetupButtons [value_in_milliseconds] command - typical 100mS

    Log should be something like this:

    TM1638 Driver Development Progress: Updates on Module, Code, and Integration Features
  • #6 20554205
    p.kaczmarek2
    Moderator Smart Home
    I've added ability to fire events for TM1638 buttons:
    
    addEventHandler OnCustomDown 1 echo Button 1 is going down
    addEventHandler OnCustomUp 1 echo Button 1 has been released
    
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #7 20554255
    DeDaMrAz
    Level 19  
    It looks like it is working, see the picture.

    TM1638 Driver Development Progress: Updates on Module, Code, and Integration Features

    Added after 9 [minutes]:

    addEventHandler OnCustomDown 1 TMGN_Brightness 1
    addEventHandler OnCustomUp 2 TMGN_Brightness 7

    or entire script for testing:

    startDriver NTP
    ntp_timeZoneOfs  +2:00
    TMGN_Clear
    
    addEventHandler OnCustomDown 1 TMGN_Brightness 1
    addEventHandler OnCustomUp 2 TMGN_Brightness 7
    
    again:
    // TMGN_Print  offset len value bPadToLenWithZeros
    TMGN_Print 6 2 $second 2
    TMGN_Print 4 2 $minute 1
    TMGN_Print 2 2 $hour 1
    goto again




  • #8 20554662
    p.kaczmarek2
    Moderator Smart Home
    Hello, your script is incomplete.

    You've forgot to include:
    
    TMGN_SetupButtons 100
    

    required to setup button scan every 100ms.

    Buttons will not work without that.
    Helpful post? Buy me a coffee.
  • #9 20554680
    DeDaMrAz
    Level 19  
    p.kaczmarek2 wrote:
    Hello, your script is incomplete.

    You've forgot to include:
    
    TMGN_SetupButtons 100
    

    required to setup button scan every 100ms.

    Buttons will not work without that.


    Correct, I apologize for that, testing was intense and I missed that. Here is the correct script for testing that is working for me - build 1.17.48

    startDriver NTP
    ntp_timeZoneOfs  +2:00
    TMGN_Clear
    TMGN_SetupButtons 100
    
    addEventHandler OnCustomDown 1 TMGN_Brightness 1
    addEventHandler OnCustomUp 2 TMGN_Brightness 7
    
    again:
    // TMGN_Print  offset len value bPadToLenWithZeros
    TMGN_Print 6 2 $second 2
    TMGN_Print 4 2 $minute 1
    TMGN_Print 2 2 $hour 1
    goto again
  • #10 20556895
    p.kaczmarek2
    Moderator Smart Home
    TM1638 seems to be fully supported now.

    TM1650 and HT16K33 are up next!
    TM1638 Driver Development Progress: Updates on Module, Code, and Integration Features
    Helpful post? Buy me a coffee.

Topic summary

Development of the TM1638 driver is progressing, with updates on module integration and code functionality. The TM1638 operates with one segment per digit, differing from the TM1637's grid-based approach. Recent builds have introduced commands for clearing displays, printing values, and mapping functionalities. The driver now supports button event handling, allowing for actions on button presses. A complete script for testing has been shared, ensuring proper button setup and functionality. The TM1638 is reported to be fully supported, with plans to extend support to TM1650 and HT16K33 models next.
Summary generated by the language model.
ADVERTISEMENT