Created
January 5, 2017 22:37
-
-
Save sasha42/ff25bb59b50adf03359bb1d3265d8d78 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time, sys, os | |
global pwm | |
from Adafruit_PWM_Servo_Driver import PWM | |
# Set LED parameters | |
pwm = PWM(0x40) | |
pwm.setPWMFreq(1000) | |
print("LEDs are initialised") | |
while True: | |
for x in range(10): | |
pwm.setPWM(2, x*400+1) | |
print("up {}".format(x*400)) | |
time.sleep(0.1) | |
for x in range(10): | |
pwm.setPWM(2, 4001-(x*400)) | |
print("down {}".format(4001-(x*400))) | |
time.sleep(0.1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment