Created
September 26, 2021 20:46
-
-
Save ScienceElectronicsFun/072ca2d526ba77a937bcafbffef0d27f to your computer and use it in GitHub Desktop.
Controlling a Gikfun DC motor with a raspberry pi pico
This file contains hidden or 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 | |
import time | |
led = Pin(15, Pin.OUT) | |
button = Pin(14, Pin.IN, Pin.PULL_DOWN) | |
while True: | |
if button.value(): | |
led.value(1) | |
time.sleep(1) | |
led.value(0) | |
else: | |
led.value(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment