Saturday, 4 March 2023

TTB04a: Creating a Knight Rider LED display using a Pi Pico W

from machine import Pin from time import sleep for i in range (8,14): Pin((i), Pin.OUT) delay = 0.2 kr=[8,0,8,9,0,9,10,0,10,11,0,11,12,0,12,13,0,13] def KITT(): for j in range(len(kr)): if kr[j] == 0: sleep(delay) else: Pin(kr[j]).toggle() try: while True: KITT() except KeyboardInterrupt: for k in range(8,14): Pin(k).value(0) print('Keboard Interrupted, LEDs off') #https://www.youtube.com/watch?v=cGgDzVtppaQ

No comments: