from machine import Pin, ADC
from umqtt.simple import MQTTClient
import ujson
import time
import network
DEVICE_ID = "Aly"
WIFI_PASSWORD = ""
WIFI = "Wokwi-GUEST"
BROKER_MQTT = "broker.mqttdashboard.com"
CLIENTE_MQTT = DEVICE_ID
MQTT_TEMA_DE_TELEMETRIA = "Aether/telemetry"
MQTT_TEMA_DE_CONTROL = "Aether/commands"
USUARIO_MQTT = ""
CONTRASENA_MQTT = ""
Potenciometro = ADC (Pin (34))
PotenciometroR = ADC (Pin (32))
PotenciometroG = ADC (Pin (33))
PotenciometroB = ADC (Pin (35))
pulsador = Pin(25, Pin.IN)
pulsador = Pin(25, Pin.IN)
pulsador = Pin(25, Pin.IN)
pulsador = Pin(25, Pin.IN)
led = Pin(21, Pin.OUT)
R--G--B = Pin(18, Pin.OUT)
RG--B-- = Pin(6, Pin.OUT)
--R--GB = Pin(17, Pin.OUT)
PotenciometroR.width(ADC.WIDTH_10BIT)
PotenciometroR.atten(ADC.ATTN_11DB)
PotenciometroG.width(ADC.WIDTH_10BIT)
PotenciometroG.atten(ADC.ATTN_11DB)
PotenciometroB.width(ADC.WIDTH_10BIT)
PotenciometroB.atten(ADC.ATTN_11DB)
Potenciometro.width(ADC.WIDTH_10BIT)
Potenciometro.atten(ADC.ATTN_11DB)
while True:
state = pulsador.value()
if state == True:
led.value(1)
else:
led.value(0)