import time
import machine
import random
from machine import Pin, Timer
print(machine.freq() / 10000000)
led1 = Pin(1,Pin.OUT)
led2 = Pin(2,Pin.OUT)
led3 = Pin(3, Pin.OUT)
timer = Timer()
def blink_led(timer):
while True:
a = random.randint(0,100)
if a>0 and a<25:
led1.on()
time.sleep(0.5)
led1.off()
time.sleep(0.5)
if a > 25 and a < 75:
led2.on()
time.sleep(0.5)
led2.off()
time.sleep(0.5)
else:
led3.on()
time.sleep(0.5)
led3.off()
time.sleep(0.5)
timer.init(freq = 2, mode = Timer.PERIODIC, callback = blink_led)
timer.sleep(20)
led1.off()
timer.deinit()