"""
MicroPython IoT Weather Station Example for Wokwi.com
To view the data:
1. Go to http://www.hivemq.com/demos/websocket-client/
2. Click "Connect"
3. Under Subscriptions, click "Add New Topic Subscription"
4. In the Topic field, type "wokwi-weather" then click "Subscribe"
Now click on the DHT22 sensor in the simulation,
change the temperature/humidity, and you should see
the message appear on the MQTT Broker, in the "Messages" pane.
Copyright (C) 2022
"""
import network
import time
from machine import Pin
SSID = 'EspWokwi'
PASSWORD = "test"
print("<<< WIFI Access Point >>>")
#crea el led asociado al pin 13
led = Pin(2,Pin.OUT)
led.off() #apaga el led
print("Creating network...")
ap_if = network.WLAN(network.AP_IF)
ap_if.config(essid=SSID, password=PASSWORD)
ap_if.active(True)
print("IP Address: ", ap_if.ifconfig()[0])
print("Gateway Address: ", ap_if.ifconfig()[2])
initial_value = 1
while True:
initial_value^=1
led.value(initial_value)
time.sleep(1)