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