I have just started with programming on a raspberry pi pico, and I was wondering if you can make python start another function, even though the other one is still running, so I want multiple functions to run at once (but with a bit of delay between them). What I have found out myself, is that there is an extension called "Threading" but I do not know how you can install that on the Pico. My current code:
The function:
def dimming(PinNumber):
PinN = PWM(Pin(PinNumber))
PinN.freq(1000)
for duty in range(65025):
PinN.duty_u16(duty)
time.sleep(0.0001)
for duty in range(65025, 0, -1):
PinN.duty_u16(duty)
time.sleep(0.0001)
The code that starts the function:
while True:
for i in range(6):
dimming(i)
time.sleep(0.3)