aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgeremy@pubnub.com2014-12-28 17:06:50 -0800
committergeremy@pubnub.com2014-12-28 17:06:50 -0800
commit0b7db06db124ccffb6d87e97599938b377ee1368 (patch)
tree6c0cde7f0ac069e5b4edc13b79dac31794dfc749
parentb89bc8cb03f0534805c2112d5fa4253f82ab616f (diff)
downloadpubnub-python-0b7db06db124ccffb6d87e97599938b377ee1368.tar.bz2
adjusting for better flickering
-rw-r--r--python/examples/pnPWM/Servo_Example.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/python/examples/pnPWM/Servo_Example.py b/python/examples/pnPWM/Servo_Example.py
index c5ca88a..cb0185f 100644
--- a/python/examples/pnPWM/Servo_Example.py
+++ b/python/examples/pnPWM/Servo_Example.py
@@ -2,13 +2,14 @@
from Adafruit_PWM_Servo_Driver import PWM
import time
+import random
# ===========================================================================
# Example Code
# ===========================================================================
# Initialise the PWM device using the default address
-pwm = PWM(0x40, debug=True)
+pwm = PWM(0x40, debug=False)
# Note if you'd like more debug output you can instead run:
#pwm = PWM(0x40, debug=True)
@@ -30,9 +31,9 @@ while (True):
for x in range(0,15) :
# Change speed of continuous servo on channel O
pwm.setPWM(x, x, servoMin)
- time.sleep(0.0001)
+ time.sleep(random.uniform(0.005,0.0001))
pwm.setPWM(x, x, servoMax)
- time.sleep(0.0001)
+ time.sleep(random.uniform(0.005,0.0001))