So, I was wondering if I could light up an led a little bit, so the led wasn't neither off, or completely on.
The only way I found on Google to do that was with pigpio, so I installed the program on my Pi 3 and ran it by using sudo pigpiod, then I decided to write a code to see if it worked, but with no success, here is the code:
import pigpio
pi = pigpio.pi()
try:
while(True):
red = raw_input("Red. 1-255.-->")
redCol = int(red)
if (redCol >= 1 and redCol <= 255):
pi.set_PWM_dutycycle(11,redCol)
else:
print("Invalid Value")
green = raw_input("Green. 1-255.-->")
greenCol = int(green)
if (greenCol >= 1 and greenCol <=255):
pi.set_PWM_dutycycle(13,greenCol)
else:
print("Invalid Value")
blue = raw_input("Blue. 1-255.-->")
blueCol = int(blue)
if (blueCol >= 1 and blueCol <= 255):
pi.set_PWM_dutycycle(15,blueCol)
else:
print("Invalid Value")
except KeyboardInterrupt:
pi.stop()
When I run the code It prompts me to the color 'selection' input, but when I input something the led does nothing.