Created
May 31, 2019 17:47
-
-
Save detik19/a0d5baa2db7f9af87eaebb5e56537dd9 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