parent
520b374ace
commit
7bdbc9a737
15
main.py
15
main.py
|
@ -117,7 +117,6 @@ if __name__ == '__main__':
|
||||||
@app.route('/mode', methods=['GET'])
|
@app.route('/mode', methods=['GET'])
|
||||||
def mode():
|
def mode():
|
||||||
global mode
|
global mode
|
||||||
global power
|
|
||||||
global r
|
global r
|
||||||
global g
|
global g
|
||||||
global b
|
global b
|
||||||
|
@ -142,14 +141,14 @@ if __name__ == '__main__':
|
||||||
mode = 1
|
mode = 1
|
||||||
return 'Color: '+str(r)+','+str(g)+','+str(b)
|
return 'Color: '+str(r)+','+str(g)+','+str(b)
|
||||||
|
|
||||||
@app.route('/power')
|
@app.route('/power', methods=['GET'])
|
||||||
def power():
|
def power():
|
||||||
if power == True:
|
global power
|
||||||
power = False
|
power = request.args.get('power')
|
||||||
return "Power off"
|
if power is None:
|
||||||
else:
|
return 'No power argument specified'
|
||||||
power = True
|
elif power == "":
|
||||||
return "Power on"
|
return 'No power argument specified'
|
||||||
|
|
||||||
strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL)
|
strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL)
|
||||||
strip.begin()
|
strip.begin()
|
||||||
|
|
Loading…
Reference in New Issue