User manual
83
Fig. 10.5: Four LEDs are flashing using different patterns.
The programme ledtk02.py is built on the previous programme, but has been expanded to include the
radio buttons and the functions of the LED chasing lights and flashing patterns.
import RPi.GPIO as GPIO
import time
from Tkinter import *
GPIO.setmode(GPIO.BCM)
LED = [4,18,23,24]
for i in LED:
GPIO.setup(i, GPIO.OUT, initial=0)
w = 5; t = 0.2
pattern = [
(“Chasing to the left",1),
(“Flashing",2),
(“Chasing to the right”,3),