Last active
August 7, 2022 13:49
-
-
Save romilly/1e4e0751e6be029880be2f3c60131ff9 to your computer and use it in GitHub Desktop.
This file contains 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
""" | |
Example for remote control from host via Serial link. | |
This is the code to run on the Pico. | |
It sets up the onboard LED and allows you to turn it on or off. | |
""" | |
from machine import Pin | |
# use onboard LED which is controlled by Pin 25 | |
# on a Pico W the onboad lLED is accessed differently, | |
# so commeent out the line below | |
# and uncomment the line below that | |
led = Pin(25, Pin.OUT) # veresion for Pico | |
# led = Pin('LED', Pin.OUT) # version for Pico W | |
# Turn the LED on | |
def on(): | |
led.value(1) | |
# Turn the LED off | |
def off(): | |
led.value(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment