; FIGURE 34: Servo dial top.
; FIGURE 33:
Angle’s dial.
Lab 4:
; FIGURE 35:
Servo dial.
Setting an
Angle on a
Servomotor.
Parts required:
; FIGURE 36:
Servo dial side.
1 Arduino
1 USB cable
; Clip 1/8” notches around the shape so that you can
force the mini servo into the hole; have the clipped
edges squeezed tight to the mini servo.
1 Arduino proto shield
1 Three-pin header
1 Mini servomotor
1 Printout of the servo angle and pointer image shown in
Figure 33
; Use scissors again to make a small hole in the base of
the dial, then use the smaller of the screws shown in
Figure 34 to attach the dial to the mini servo.
1 Piece of cardboard (cereal box) to accommodate the
compass and dial
; Open the A101_5_Servo_Angle.ino program [at the
article link].
1 Double-sided sticky tape
1 Pair of scissors
Estimated time for this lab: 30 minutes
; Notice that the servo angle and the compass angle are
in opposite directions, so the code is modified to show
the angle entered into the serial monitor as the angle
the servo points to:
Check off when complete:
; Print the angle’s dial and pointer shown in Figure 33.
[Note this image can be found at the article link.]
; Place strips of double-sided sticky tape on the back of
the angle’s dial and pointer printout.
; Place it on the cardboard (from a cereal box, for
example) and carefully smooth it down.
; Cut out the angle’s dial and pointer.
; Look at Figures 34, 35, 36, and 37 to get a feel for how
to cut out the holes to mount the compass and the dial.
; Use scissors to make a tiny hole in the center of the
compass, then clip out a shape like the top of the mini
servo — a larger circle at the center and a smaller circle
to the side. This should match the top of the mini servo
in shape, but be about 1/8” smaller.
// Servo Angle // 3/7/14 Joe Pardue #include <Servo.h> Servo myservo; // create servo object to // control a servo int pos = 0; // variable to store the servo // position String readString; void setup() { myservo.attach(9); // attaches the servo on // pin 9 to the servo // object // initialize the serial communication: Serial.begin(57600); Serial.flush(); Serial.println(“Servo Angle 1.0”);
20 May 2014