import network
import time
import urequests

print("Connecting to WiFi", end="")
sta_if = network.WLAN(network.STA_IF)
sta_if.active(True)
sta_if.connect('Wokwi-GUEST', '')
while not sta_if.isconnected():
  print(".", end="")
  time.sleep(0.1)
print(" Connected!")

resp = urequests.get("https://v2.jokeapi.dev/joke/Programming")
joke_dict = resp.json()
print("Here's a joke!")
if 'joke' in joke_dict:
  print(joke_dict['joke'])
else:
  print(joke_dict['setup'])
  print(joke_dict['delivery'])

print()
esp:VIN
esp:GND.2
esp:D13
esp:D12
esp:D14
esp:D27
esp:D26
esp:D25
esp:D33
esp:D32
esp:D35
esp:D34
esp:VN
esp:VP
esp:EN
esp:3V3
esp:GND.1
esp:D15
esp:D2
esp:D4
esp:RX2
esp:TX2
esp:D5
esp:D18
esp:D19
esp:D21
esp:RX0
esp:TX0
esp:D22
esp:D23
Arduino Code Sharing - Embedded Project