So connected and rgb led strip and wrote a simple program which in a loop increases the value of the R, G and B led until it is 100 and then i should restart at 1 again:
For the first 40 - 60 steps there is output and then all leds are turned off?
Does somebody can shine a light at this issue for me?
Code: Select all
import RPi.GPIO as GPIO import time rood = 0 blauw = 0 groen = 0 frequentie = 0 s1 = 1 #sleep variable GPIO.setwarnings(False) GPIO.setmode(GPIO.BOARD) red = 11 blue = 13 green = 15 GPIO.setup(red, GPIO.OUT) GPIO.setup(green, GPIO.OUT) GPIO.setup(blue, GPIO.OUT) print GPIO.VERSION x = 1 while x < 100: print "rood, blauw en groen op : ", x, ", frequentie op 100, delay = 5" RED = GPIO.PWM(red, 100) RED.start(x) #time.sleep (s1) GREEN = GPIO.PWM(green, 100) GREEN.start(x) #time.sleep (s1) BLUE = GPIO.PWM(blue, 100) BLUE.start(x) time.sleep(s1) x = x + 1 if x == 99: x = 1 print("\n") x = raw_input("eind rood, blue and green 0..100") RED.stop() GREEN.stop() BLUE.stop() GPIO.cleanup() print "............einde gpio cleanup"