Hallo Leute,
ich bin Anfänger was das Thema Python angeht und ich möchte eine LED am PIFACE gedimmt ansteuern.
Ich habe mir aus dem INet dieses folgende BSp Proggie geladen von hier geladen:
https://github.com/Gadgetoid/WiringPi2-Python
Python
import wiringpi2
from time import sleep
PUD_OFF = 0
PUD_DOWN = 1
PUD_UP = 2
pins = [2,3,4,5,6,7]
# Setup WiringPi
wiringpi2.wiringPiSetupSys()
# Init piFace at Base 200
result = wiringpi2.piFaceSetup(200)
print "Result from piFaceSetup(200): {}".format(str(result))
# create a softPwm at port 205 and start at 20%
wiringpi2.softPwmCreate(205, 20, 100)
sleep(2)
# Enable internal pull-ups & start with all off
for pin in pins:
wiringpi2.pullUpDnControl(200+pin, PUD_UP)
wiringpi2.digitalWrite(200+pin, 0)
print "Set softPwm at Port 205 to 10% ..."
wiringpi2.softPwmWrite(205, 10)
sleep(2)
print "Set softPwm at Port 205 to 70% ..."
wiringpi2.softPwmWrite(205, 70)
sleep(2)
print "Set softPwm at Port 205 to 100% ..."
wiringpi2.softPwmWrite(205, 100)
sleep(2)
Alles anzeigen
Nun habe ich das Problem, das die LED am PIFACE Ausgang 5 immer nur den Wert von dem Aufruf
pwm = wiringpi2.softPwmCreate(205, 20, 100)
anzeigt, nämlich die 20% (ich sehe auch an der LED. dass diese ganz schön am flankern ist...das will wohl jemand andere PWM Werte einstellen und kann / darf nicht).
Ich habe schon im INet gesucht aber leider nix gefunden.
Wahrscheinlich ist es etwas ganz einfaches.
Kann mir jemand bitte helfen?
Besten Dank
Gruß
Vaux