From 230d8f2f1f13a44ab7eb9a1724e26eacd9e967d0 Mon Sep 17 00:00:00 2001 From: gcohen Date: Tue, 6 Jan 2015 00:23:51 -0800 Subject: thread test --- python/examples/futureHouse/futureHouse.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python/examples/futureHouse/futureHouse.py b/python/examples/futureHouse/futureHouse.py index d2204cb..92ff974 100644 --- a/python/examples/futureHouse/futureHouse.py +++ b/python/examples/futureHouse/futureHouse.py @@ -1,6 +1,7 @@ import sys from Pubnub import Pubnub from Adafruit_PWM_Servo_Driver import PWM +import thread import time import random import Adafruit_BMP.BMP085 as BMP085 @@ -192,7 +193,14 @@ def cycleLEDs(x): while (True): + for x in range(0,7) : # print str(x) + ": " + str(leds[x]['minPulseLength']) + " " + str(leds[x]['maxPulseLength']) + " " + str(leds[x]['waitFloor']) + " " + str(leds[x]['waitCeiling']) # Change speed of continuous servo on channel O - cycleLEDs(x) + try: + thread.start_new_thread( cycleLEDs, (x,) ) + except: + print "Error: unable to start thread" + + + #cycleLEDs(x) -- cgit v1.2.3