Snapping Dinosaur

nom nom T Rex

Step 1

Step 1

I made the T Rex automata first. I used kebab sticks, a cardboard box, paper and hot glue to put it all together. I used this pdf to help me build the automata.

 

Step 2

Step 2

I then used a servo motor and attached this to the ThinkerShield putting the black cable to the ground, the white cable to D5 and the red cable to VCC.

 

Step 3

I then coded the ThinkerShield

#include <Servo.h>

Servo myservo; // create servo object to control a servo
 // twelve servo objects can be created on most boards

int pos = 0; // variable to store the servo position

void setup() {
 myservo.attach(5); // attaches the servo on pin 9 to the servo object
 }

void loop() {
 for (pos = 360; pos <= 360; pos += 1) { // goes from 0 degrees to 180 degrees
 // in steps of 1 degree
 myservo.write(pos); // tell servo to go to position in variable 'pos'
 delay(15); // waits 15ms for the servo to reach the position
 }
 for (pos = 360; pos >= 360; pos -= 1) { // goes from 180 degrees to 0 degrees
 myservo.write(pos); // tell servo to go to position in variable 'pos'
 delay(15); // waits 15ms for the servo to reach the position
 }
}

Step 4

Step 4

I then attached the motor to the side of the automata (after double checking that it would rotate the correct way).

Finally I attached the cog on the side of the automata and connected it to the motor using a rubber band.

Add a comment