Page 1 of 1

continuous servo code needed

Posted: Tue Jan 13, 2015 10:47 pm
by dryden makers club
I am part of a small group we call the makers club at my school. we are just starting out and have absolutely no idea what we are doing and have no experience with electronics. for our first 'project' I want to use the pi to control a continuous servo so that by the push of a button or if i wave an RFID tag by a reader it will activate the servo to turn one direction for a certain amount of time and then stop on its own and then when I do it again the servo will turn the opposite direction for the same amount of time and stop on its own. the only problem is that none of us know how to code or honestly think what coding is, so I need a code that will do what I have explained above. the raspberry pi is brand new, never used, never even plugged in or turned on. I need a code or a place where I can get a code to do that, can anyone help?

Re: continuous servo code needed

Posted: Wed Jan 14, 2015 9:56 am
by B.Goode
Perhaps try an internet search engine with the string "raspberrypi servo"

As a hint - it might be simpler to use the type of servo that moves in a 180 degree arc, rather than the continuous variety.

More broadly -
we are just starting out and have absolutely no idea what we are doing and have no experience with electronics... <stuff deleted> the only problem is that none of us know how to code or honestly think what coding is, so I need a code that will do what I have explained above. the raspberry pi is brand new, never used, never even plugged in or turned on.
It's great to have a project and a target. But for now I suggest using the Raspberry Pi Foundation site as a resource to get your RPi up and running and doing a very simplistic task like those in the Resources area. Once you have some basic experience it will be easier to ask focussed questions about particular problems you encounter in tackling your target project.

Re: continuous servo code needed

Posted: Wed Jan 14, 2015 10:36 am
by hampi
That sounds similar to my advanced DIY project

https://github.com/oh7bf/RasPiHBridge/wiki

I was testing that briefly with a DC motor

https://github.com/oh7bf/RasPiHBridge/w ... ion-Sensor

BTW this topic is more in "Automation, sensing and robotics" category.

Re: continuous servo code needed

Posted: Wed Jan 14, 2015 11:00 am
by gregeric
A continuous servo is a good choice for a novice, as they can be interfaced directly to the Pi with no need for H-bridges (they have that internal). Control them with any servo library eg Joan's http://abyz.co.uk/rpi/pigpio/python.html

It's helpful to understand the differences between a standard servo & a continuous one:
A pulse width of 1500us rotates a standard servo to its centre position, but tells the continuous servo to stop rotating.
At 500us the standard will turn to its max travel in one direction, then stop. Continuous will continue to rotate at max speed in one direction.
At 2500us the standard will turn max travel in the other direction, then stop. Continuous rotates opposite direction at max speed.

With that knowledge you should be able to adapt any code you find for standard servos & adapt to your needs.