I am currently busy with a project where i need a servo to turn, i wrote a script in WiringPi (Python & .NET) that does this:
//Set GPIO scheme. WiringPi.WiringPiSetupGpio(); //Set Pwm settings. WiringPi.PwmSetMode((int)PwmMode.Ms); WiringPi.PwmSetClock(192); WiringPi.PwmSetRange(2000); //Setup Servo WiringPi.PinMode(18, (int)PinMode.PwmOutput); //Test all components. WiringPi.PwmWrite(18, 150); WiringPi.Delay(500); WiringPi.PwmWrite(18, 170); WiringPi.Delay(500); WiringPi.PwmWrite(18, 150); WiringPi.Delay(500); WiringPi.PwmWrite(18, 130); WiringPi.Delay(500); WiringPi.PwmWrite(18, 150); WiringPi.Delay(500);
The weird thing is, it works in Python, but that is the only place where it works it seems. Controlling it every other way, will result in the servo only turning to it's maximum right position (and beyond that, a lot of noise and it will probably break it self).
I tested it with GPIO (commandline) too, it does simply not take the correct positions like it does in Python.
When i google the issue, i only find people that say the servo might be broken, this is not the case as it still works perfectly in Python. I use the same clock and range settings in all the solutions, with the position value's that work for me in Python.
Does anyone have a clue what is going on here? It's been holding me up for days already and i'm pretty much out of idea's...