aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgcohen2015-01-06 00:23:51 -0800
committergcohen2015-01-06 00:23:51 -0800
commit230d8f2f1f13a44ab7eb9a1724e26eacd9e967d0 (patch)
tree6350ad88cbf6e2eea4c3406d86f9c7e4383b7d7d
parent070a233e22e932ee2f444053ae75b413d67e8ae9 (diff)
downloadpubnub-python-230d8f2f1f13a44ab7eb9a1724e26eacd9e967d0.tar.bz2
thread test
-rw-r--r--python/examples/futureHouse/futureHouse.py10
1 files changed, 9 insertions, 1 deletions
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)