-
I just received a couple of WiPy 2.0 boards. Do you have a working example program I can download and run? I'm a newby to micropython and need a simple example, like pushing a button on one board and having an LED light up on the other board, sending data via WiFi. I looked under "tutorials and examples" but didn't see any examples there.
-
Here's a sample I've tried on my LoPy on the expansion board:
from machine import Pin led = Pin("G16", mode=Pin.OUT) #button = Pin("G17", mode=Pin.IN, pull=Pin.PULL_UP) button = Pin("G17", mode=3) while True: led(button())Note that the
mode=3is a workaround for a bug that should be fixed in tomorrow's firmware update; the commented out version is how it should've been. This script runs a loop that simply sets the LED state from the button state. I hope to update it to use an IRQ later.I've also run basic network communication, but not yet directly between the LoPys (just basic testing, like using socket.getaddrinfo to confirm internet connection). When WLAN is set up, the socket module basically behaves like in normal Python.
-
Thanks, LoneTech. I'm really looking for a WiFi example, something that would show network setup and transfer of data from one board to another.
-
To use WiFi you can follow https://docs.pycom.io/wipy/wipy/tutorial/wlan.html tutorial. More examples available at
https://github.com/wipy/wipy/tree/master/examples/blynk
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login