Academy 2013

Project Development


I have been spending this week working on my final project and it is on schedule. The goal is to make a troll head for a town festival here in Iceland and the troll should have a rotating eyes. The eyes will rotate according to an input step response I'll carry in my hands. When someone touch my left hand the eyes will move to left, if someone touch my right hand the eyes will go to right.

The project is going alright. Now I am trying to make my board control both motors at the same time.

The head is on hold now because I am waiting for the material that I will be using. It will hopefully arrive before the weekend so I will use the time then to cut out the head.

Here are my eyes connected to an Arduino. I am experementing with the codes to see if the motors can move at the same time:

fp1

Here are the codes I got so far to control the motors.

#include <Servo.h>

Servo rightservo; // right eye
Servo leftservo;   // left eye

int potpin = 0;  // analog pin used to connect the potentiometer
int val;    // variable to read the value from the analog pin

void setup()
{
  rightservo.attach(9);
  // leftservo.attach(10);
 
  // myservo.attach(9);  // attaches the servo on pin 9 to the servo object
  // myservo.attach(10);  // attaches the servo on pin 9 to the servo object  
 
  Serial.begin(9600); // thetta setti eg inn
}

 
void loop()
  rightservo.write(90);     // starting point for right eye
  rightservo.write(20);     // right eye looks to right
  rightservo.write(160);   // right eye looks to left
 
  leftservo.write(90);       // starting point for left eye
  leftservo.write(20);       // left eye looks to right
  leftservo.write(160);     // left eye looks to right

}

 

fablab
Vestmannaeyjar, Iceland