Skip to content

Instantly share code, notes, and snippets.

@HexF
Last active May 10, 2017 08:31
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 HexF/984969f571eb4eec7fea7a0c42163899 to your computer and use it in GitHub Desktop.
Save HexF/984969f571eb4eec7fea7a0c42163899 to your computer and use it in GitHub Desktop.
import time
last_time = 0
led_state = True #Put these lines with the imports
if wait_for_user_trigger:
input_state = GPIO.input(18)
if input_state == True:
GPIO.output(23,True)
continue
if time.time()*1000 > last_time + (100): #100 meaning how fast to pulse
last_time = time.time()*1000.0
led_state = not led_state
GPIO.output(23,led_state)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment