Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Where are some examples?

    Scheduled Pinned Locked Moved WiPy 2&3
    4 Posts 3 Posters 2.4k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B Offline
      bgoolsby
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • L Offline
        LoneTech
        last edited by LoneTech

        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=3 is 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.

        1 Reply Last reply Reply Quote 0
        • B Offline
          bgoolsby
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • ? Offline
            A Former User
            last edited by

            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

            1 Reply Last reply Reply Quote 0

            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
            • 1 / 1
            • First post
              Last post

            Pycom on Twitter

            Pycom