Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:extensions:servo [2018/03/13 12:41]
kniwwelino
en:extensions:servo [2018/03/13 13:25] (current)
kniwwelino
Line 1: Line 1:
 +===== Adding a servo =====
  
 +
 +==== Connecting a servo with alligator clips ====
 +You need:
 +  * 1 standard servo
 +  * 3 wires with an alligator clip on one end and a male jumper on the other end (in black, red, and orange/yellow)
 +
 +{{:en:extensions:servo_1.jpg?600|}}
 +
 +\\
 +To connect the servo:
 +  * Plug the wires to the connector of the servo: black to brown, red to red, yellow to orange.
 +  * Clip the wires to the pins of the Kniwwelino:
 +    * The **black** one to the **GND pin**
 +    * The **red** one to the **3.3V pin**
 +    * The **yellow** one to either **D5, D6 or D7**
 +
 +{{:en:extensions:servo_2.jpg?600|}}
 +
 +==== Programming servos ====
 +
 +You can program your servo with the following block.
 +
 +{{:en:programmingblocks:servo_1.png|}}
 +
 +Select the pin to which you connected your servo to (D5, D6 or D7), and set the angle to which you seek to rotate the servo. The range here needs to be between 0 and 180.
 +
 +For example, to set the servo on three different positions (0; 90; 180) depending on which button was clicked, you could use the following code:
 +
 +{{:en:programmingblocks:servo_example.png|}}