from machine import Pin
from neopixel import NeoPixel
from time import sleep_ms
pOp = Pin (23, Pin.OUT)
op = NeoPixel (pOp, 1)
op[0] = (255, 0, 0)
op.write()
sleep_ms(500) # Configurando pinos
op[0] = (255, 255, 0)
op.write()
sleep_ms(500) # Definindo estado inicial
op[0] = (0, 255, 0)
op.write()
i = 0
while True: # Operação em ciclo normal
i += 1
sleep_ms(100)
if (i % 50) == 0:
op[0] = (255, 128, 0) # Atenção
op.write()
sleep_ms(1000)
elif (i % 10) == 0: # Comunicando
op[0] = (0, 0, 255)
op.write()
sleep_ms(500)
else:
op[0] = (0, 255, 0)
op.write()