#SMpixel - control LED RGB cu Terminal BT # # PICO UART1 : Tx=pin6, RX=pin 7 # Testul se face cu un telefon mobil cu aplicatie # tip Terminal. # # cu 1 -LED aprins # cu 0 -LED stins from machine import UART, Pin import time red = Pin(18, Pin.OUT) # LED rosu green = Pin(19, Pin.OUT) # LED verde blue = Pin(20, Pin.OUT) # LED blue ser = UART(1, 300) # tx=6 rx=7 GND=8 red.low() # stare initiala green.low() blue.low() while 1: c=ser.read(1) # lectura din UART 1 #ser.write(c) # ecou if c == b'1': red.high() # rosu aprins green.low() blue.low() #time.sleep(0.3) if c == b'2': green.high() # verde aprins red.low() blue.low() #time.sleep(0.3) if c == b'3': blue.high() # albastru aprins red.low() green.low() if c == b'0': # sting red.low() green.low() blue.low()