Skip to content

Instantly share code, notes, and snippets.

@detik19
Created May 31, 2019 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save detik19/525f3042def957d8478cc480c05c8fa5 to your computer and use it in GitHub Desktop.
Save detik19/525f3042def957d8478cc480c05c8fa5 to your computer and use it in GitHub Desktop.
GPIO Pin MicroPython
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