This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# udp_recv_code.py -- receive UDP messages from any receiver, can be another CircuitPython device | |
# 24 Aug 2022 - @todbot / Tod Kurt | |
# cribbing from code at https://github.com/adafruit/circuitpython/blob/main/tests/circuitpython-manual/socketpool/datagram/ntp.py | |
import time, wifi, socketpool | |
from secrets import secrets | |
print("Connecting to WiFi...") | |
wifi.radio.connect(ssid=secrets['ssid'],password=secrets['password']) | |
print("my IP addr:", wifi.radio.ipv4_address) | |
pool = socketpool.SocketPool(wifi.radio) |