help
I am using a raspberry pi and I have this code set to blink lights for 10 seconds. I am using a library called bottle from bottlepy.org to allow me to run a specific function tied to a web url. Ex. if i say @route('/bug') def bug(): print("Hello World") then going to the ip address of the pi followed by :1234/bug will run just that function. Here is my code followed by my issue. # Import Libraries import RPi.GPIO as GPIO import time from bottle import route, run #Setup GPIO Pins GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(17,GPIO.OUT) GPIO.setup(15,GPIO.OUT) #Set always on GPIO to Off GPIO.output(17,GPIO.LOW) timeout=time.time() + 10 print "Lets Start Blinking!!!!" @route('/blink') def blink(): GPIO.output(17,GPIO.HIGH) time.sleep(1) GPIO.output(17,GPIO.LOW) GPIO.output(15,GPIO.HIGH) time.sleep(1) GPIO.output(15,GPIO.LOW) while True: blink() if time.time()> timeout: break continue run(host='192.168.1.70' , port=1234) When I first run the program the lights blink for 10 seconds. Then I go to the url on my phone and click enter and it only blinks the lights once and does not blink for the full 10 seconds. Anyone have any idea whats wrong with my code?