Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Library to work with displays based on TM1638 (Oshonsoft Pic Basic Compiler).

DogFlu66

Member
After the experience in programming the library to work with the TM1637 (the 4-digit card only and the 6-digit and 6-key card), I have created the library to control the TM1638. In this case, the TM1638-based card that I have used is composed of 8 digits, 8 LEDs and 8 keys. All the elements that it has can be handled individually using the functions created.

For communication with the board, 3 wires or signals are used. The protocol is not I2c or SPI, it uses its own protocol which is very simple.

The main functions are the following:
SmgDisplayTM1638(): initializes the display.
BrightTM1638(MAX_BRIGHT): sets the brightness level.
DisplayStringTM1638(string): sends a string type data to the display, it is the multipurpose function par excellence (allows you to send any type of variable after converting it to string).
WriteRawDigitTM1638(Byte, DIGITx): sends an integer byte value individually to each digit on the display.
DisplayValuesTM1638(Byte0, ....., Byte7): sends 8 bytes (integer) simultaneously that correspond to each one of the digits.
WriteRawLedTM1638(status, LEDx): turns on or off the LED indicated on the card.
ScanKeyTM1638(): reads each one of the keys individually or simultaneously.

I'm leaving the files for anyone who wants to order one of these low-priced cards and wants to play with it for a while.

Example video.

TM1638.jpg
 

Attachments

  • Test TM1638_Keys.bas
    5.2 KB · Views: 39
  • _TM1638Library.bas
    10.4 KB · Views: 40
  • _SetUpAmicus18.bas
    2.9 KB · Views: 46
  • _Pic18F26K22Library.bas
    43.3 KB · Views: 39
Last edited:

Latest threads

New Articles From Microcontroller Tips

Back
Top