

Use the “number” method to show an integer. For example, if you do show(“halo”) and then show(“20”), the screen will read 20lo.ġ2. You don’t need to blank the display when changing it, but if you use another show command with less than the maximum number of characters, any characters you don’t replace will stay on the screen. Note that if you don’t blank the display, it will remain on when your program is finished executing. Blank the screen by using “show” with four blank spaces (assuming you have four digits on your screen). Be sure to put the parameter string in quotes. If you enter more than four characters, only the first four will be shown. These can be letters or numbers, but note that many letters, W for example, will look awkward. Use the “show” method to display any four characters. Create an instance of the tm1637.TM1637 object called “mydisplay” and enter the correct pin numbers for the CLK and DIO pins as parameters.

We will use the utime library to put a one-second “sleep” delay between each function so you have time to watch them on the display.ĩ. Create a new MicroPython script in Thonny or the MicroPython IDE of your choice.Ĩ. Since the Pico with MicroPython doesn’t appear as a drive letter, the easiest way to do this is to open tm1637.py in Thonny or the IDE or your choice and save it from there.ħ. Copy tm1637.py to your Pico’s root directory.
#Tm1637 pic library download
Download the tm1637.py file from Mike Causer’s TM1637 github project. We’re going to rely heavily on the excellent TM1637 MicroPython library from Mike Causer and create a script which shows a variety of display options, which you can use in your own projects later on.ĥ.
#Tm1637 pic library how to
(Image credit: Tom's Hardware) How to Code a 7-Segment Display in MicroPython
