Created
May 25, 2021 14:45
-
-
Save iwootten/de5d2ead775430fa4bbe55a46a42a06e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import picokeypad as keypad | |
| keypad.init() | |
| keypad.set_brightness(1.0) | |
| lit = 0 | |
| last_button_states = 0 | |
| colour_index = 0 | |
| NUM_PADS = keypad.get_num_pads() | |
| while True: | |
| for colour_index in range(0, 5): | |
| for i in range(0, NUM_PADS): | |
| if colour_index == 0: | |
| keypad.illuminate(i, 0x00, 0x20, 0x00) | |
| elif colour_index == 1: | |
| keypad.illuminate(i, 0x20, 0x20, 0x00) | |
| elif colour_index == 2: | |
| keypad.illuminate(i, 0x20, 0x00, 0x00) | |
| elif colour_index == 3: | |
| keypad.illuminate(i, 0x20, 0x00, 0x20) | |
| elif colour_index == 4: | |
| keypad.illuminate(i, 0x00, 0x00, 0x20) | |
| elif colour_index == 5: | |
| keypad.illuminate(i, 0x00, 0x20, 0x20) | |
| keypad.update() | |
| time.sleep(0.1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment