Last active
November 15, 2025 17:33
-
-
Save Tilka/7207d1cb1436e6c4279aa0b69ecb8f43 to your computer and use it in GitHub Desktop.
MicroPython script to let a Starlight Wii boot, replacing the serial connection to the controller select board
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
| from machine import Pin, UART | |
| from neopixel import NeoPixel | |
| # RGB pin for RP2040-Zero | |
| rgb = Pin(16, Pin.OUT) | |
| np = NeoPixel(rgb, 1) | |
| uart0 = UART(0, baudrate=19200, tx=Pin(0), rx=Pin(1)) | |
| red = (10, 0, 0) | |
| green = (0, 10, 0) | |
| blue = (0, 0, 10) | |
| black = (0, 0, 0) | |
| while True: | |
| np[0] = blue | |
| np.write() | |
| state = 0 | |
| while True: | |
| b = uart0.read(1) | |
| if b is None: | |
| continue | |
| print('got', b.hex()) | |
| if b[0] == 0xFF: | |
| break | |
| if b[0] in (0xFC, 0xFD, 0x97): | |
| np[0] = black if np[0] == green else green | |
| else: | |
| np[0] = red | |
| np.write() | |
| result = bytes([state ^ 0x6A]) | |
| print('sending', result.hex()) | |
| uart0.write(result) | |
| state = (state + b[0]) & 0xFF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment