Created
May 31, 2019 17:47
-
-
Save detik19/cdfa67bd7b7b314d3151834091c56a88 to your computer and use it in GitHub Desktop.
GPIO Pin MicroPython
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
from machine import Pin | |
from time import sleep | |
led = Pin(2, Pin.OUT) | |
button = Pin(4, Pin.IN) | |
while True: | |
led.value(button.value()) | |
sleep(0.1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment