Last active
November 24, 2021 02:16
-
-
Save inderpreet/a552f03b61ebefbe135dea8fcbea568f to your computer and use it in GitHub Desktop.
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
import RPi.GPIO as G | |
import time | |
G.setmode(G.BCM) | |
G.setwarnings(False) | |
G.setup(7, G.OUT) | |
G.setup(25, G.IN, pull_up_down=G.PUD_UP) | |
toggle = 1 | |
data = 1 | |
while( data == 1 ): | |
G.output(7, toggle) | |
toggle = not toggle | |
time.sleep(0.5) # makes the led blink at 1Hz | |
data = G.input(25) | |
G.cleanup() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment