0% found this document useful (0 votes)
18 views6 pages

Experiment 3 MSK Raspberry 7SegDisplay

This document provides instructions for connecting a 4-digit 7-segment display to a Raspberry Pi using a TM1637 controller. It includes a connection diagram, descriptions of the script functions used to control the display, and an example TM1637 script to display the current time.

Uploaded by

Manoj Kavedia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views6 pages

Experiment 3 MSK Raspberry 7SegDisplay

This document provides instructions for connecting a 4-digit 7-segment display to a Raspberry Pi using a TM1637 controller. It includes a connection diagram, descriptions of the script functions used to control the display, and an example TM1637 script to display the current time.

Uploaded by

Manoj Kavedia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

4 digits-7 segments Display

with TM1637 controller


Er. Manoj S. Kavedia
www.kaizenfuturetech.com
www.kavediasir.yolasite.com
9324258878 / 8329988738
Connection diagram Raspberry Pi
Connect the LED to your Raspberry Pi according to the following diagram:

TM1637 Board PinPosition RPI Pin Raspberry Function


GND Ground 14 GND
VCC + 5V Power 4 5V
DI0 Data In 18 GPIO 24
CLK Clock 16 GPIO 23
Script functions

The clock script uses the functions below, defined in tm1637.py:

Display.Clear() - Makes the display empty if individual LEDs are still active.

Display.SetBrightnes(x) - After this you can adjust the brightness of the display,
minimum 0 and maximum 7.

Display.Show(x,x,x,x) - Shows the actual 4 digits (digits), x can be 0 to 9.

Display.ShowDoublepoint(status) - Control for the ':' between the second and third
digit, true (1) = on / false (0) = off.
TM1637 script
wget https://raspberrytips.nl/files/tm1637.py

# https://raspberrytips.nl

import sys
import time
import datetime
import RPi.GPIO as GPIO
import tm1637

#CLK -> GPIO23 (Pin 16)


#Di0 -> GPIO24 (Pin 18)

Display = tm1637.TM1637(23,24,tm1637.BRIGHT_TYPICAL)

Display.Clear()
Display.SetBrightnes(1)
TM1637 script
while(True):
now = datetime.datetime.now()
hour = now.hour
minute = now.minute
second = now.second
currenttime = [ int(hour / 10), hour % 10, int(minute / 10), minute % 10 ]

Display.Show(currenttime)
Display.ShowDoublepoint(second % 2)

time.sleep(1)
Er. Manoj S. Kavedia

Contact on Watsapp to join Students Forum : 9324258878

You might also like