Created
September 21, 2017 09:57
-
-
Save simform-solutions/f0ac1ee5e11433c7b6ed616352e32611 to your computer and use it in GitHub Desktop.
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
#turn on and off led according to transaction | |
def blink_led(is_on): | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setwarnings(False) | |
GPIO.setup(18,GPIO.OUT) | |
try: | |
if is_on: | |
GPIO.output(18,GPIO.HIGH) | |
time.sleep(1) | |
else: | |
GPIO.output(18,GPIO.LOW) | |
time.sleep(1) | |
finally: | |
GPIO.cleanup() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment