match case in micropython – SyntaxError: invalid syntax

I am using python 3.10.5 on my raspberry pi pico and I am trying to use match & case instead of if statements When I try to run the program it returns an error: Traceback (most recent call last): File "<stdin>", line 22 SyntaxError: invalid syntax Here is my function: async def BlueTooth(delay): while True:… Read More match case in micropython – SyntaxError: invalid syntax

Trying to make a Raspberry Pi Pico project that blinks a light in morse code. How would I get the separate character from the "word" variable?

from machine import Pin from time import sleep led = Pin(0, Pin.OUT) def dot(): led.value(1) sleep(0.5) led.value(0) sleep(2) def dash(): led.value(1) sleep(1) led.value(0) sleep(2) # 0.5 Seconds = Dot # 1 Second = Dash # word to be translated word = "Hi" >Solution : You can treat a string in Python as a list, for… Read More Trying to make a Raspberry Pi Pico project that blinks a light in morse code. How would I get the separate character from the "word" variable?