Servo Principle
If you have read the long and detailed servo tutorial, you know how it works. But how do you write code to send a square wave?
There are different ways of generating a square wave with required frequency and duty cycle. The most common amongst them are using a microcontroller, or a 555 timer IC circuit. The third and crude (read it as simple) way is to use a transmitter of any of your RC toys which generates required pulses, but is out of scope of this tutorial (actually there is nothing to learn, just press a button or move the joystick of your Remote control and it generates appropriate square waves).
In the next section, we will see how to generate required pulses using a microcontroller. Before that, the following chart shows the required flow for running a servo. (click for higher resolution image)
Do you have anything to say?
Visit the Forum to discuss, learn and share anything related to robotics and electronics !!