#l7b - instalare si test Micropython de pe Rpi zero 2 /4 #---------------------------------------------------- # Se lanseaza Python3 env cu comanda: #>pyhon3 -m venv venv #>source venv/bin/activate # # Se instaleaza rshel: #>pip install rshelll # Se activeaza rshell: #>rshell -p /dev/ttyACM0 --buffer-size # Se transfera sml7b.py in Pico astfel: #>cp sml7b.py /pyboard/main.py # Se lanseaza in executie Python de pe Pico astfel: #>repl # Cu ctrl+D se lanseaza in executie programul transferat # Cu ctrl+C se opreste executia # Cu crl+X revenire in env # ctrl+D revenire in Linux normal #-------------------------------------------------- # Pe breadboard se fac urmatoarele conexiuni: # LED rosu conectat la GP6 - pin 9 # LED blue conectat la GP7 - pin 10 # LED amber conectat la GP8 - pin 11 from machine import Pin from utime import sleep ledred = Pin(6, Pin.OUT) ledblue= Pin(7, Pin.OUT) ledamber= Pin(8, Pin.OUT) while 1: ledred.off() # aprind LED sleep(0.2) ledred.on() # sting LED sleep(0.2) ledblue.off() # aprind LED sleep(0.2) ledblue.on() # sting LED sleep(0.2) ledamber.off() # aprind LED sleep(0.2) ledamber.on() # sting LED sleep(0.2) #In caz de nefunctionare se verifica conexiunile Pico-LED.