amil
Posts: 2
Joined: Mon Jan 18, 2016 2:12 am

Controlling servo motor WebIOPi

Thu Feb 18, 2016 4:47 am

Hello,

All I want to do is run a python script for a servo motor.
I've exhausted basically all my opinions and coming close to a deadline.
I just want a servo to move from 0 degrees to 180 degrees in a loop.
Sounds easy right? I'd very much appreciate someones help.

Best,

Alex

User avatar
joan
Posts: 14960
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Controlling servo motor WebIOPi

Thu Feb 18, 2016 8:50 am

On the Pi run the pigpio daemon (sudo pigpiod).

In WebIOPi execute "pigs s 4 1000" to move a servo on (Broadcom) GPIO 4 to one extreme and "pigs s 4 2000" to move to the other extreme. Put that in whatever WebIOPi uses for a loop.

Note, pigs is a program which normally resides in /usr/local/bin. Make sure your WebIOPi "user" has that as part of their executable path.

Return to “Automation, sensing and robotics”