Standard servo

180º standard servos are a type of motor which have a limited rotation angle. Although, It has precise control over the angle of rotation.

The ones provided for Basic Education Shield projects are microservos. Microservos behave the same as a standard servo, but are slimmer in size and exert less turning power.

Materials

  • 1 Arduino Uno board
  • 1 Basic Education Shield
  • 1 180º standard servo

Instructions

  1. Connect the servo to TinkerKit port digital 9.
  2. Make sure about the direction of connection: if you’re holding the shield with breadboard towards you, the black cable on the connector should be at the right side.

Open Example>BasicEducationShield>Help>StandardServo from Arduino.

/*
StandardServo
*/
#include <BasicEducationShield.h>
#include <Servo.h>

Servo me;

void setup(){
//Servo is initialized,
me.attach(9);
}

void loop(){
//Make the servo rotate to 76 degrees.
me.write(76);

}

Run the sketch, and you’ll have the servo pointing at 76 degrees. Change the degree in the code, upload it again and see if it moves to the given degree.

Due to the mechanical design of your projects, sometimes the allowed rotation angle for the servo is much smaller than 180 degrees. If you see the servo arm pushing/pulling hard against other parts of your project, try removing the servo arm, and attach it at a more appropriate angle. May need a few tries before getting this right.

It’s not working?

  1. Make sure you’ve connected the servo to the same pin as you’ve stated in the code.