// Use this code to test your motor with the Arduino board:
// if you need PWM, just use the PWM outputs on the Arduino
// and instead of digitalWrite, you should use the analogWrite command
// Motors
int irPin = 7; //
int irreading; // the analog reading from the analog resistor divider
int motor1speed = 10;
int motor1dir = 12;
int delayTime;
boolean state = false;
// Setup
void setup() {
Serial.begin(9600);
// Setup motors
pinMode(motor1speed, OUTPUT);
pinMode(motor1dir, OUTPUT);
pinMode(irPin, INPUT);
}
// Loop
void loop() {
irreading = analogRead(irPin);
Serial.println(irreading); // the raw analog reading
/* if (irreading > 135)
{
digitalWrite(motor1dir, LOW);
analogWrite(motor1speed, 200);
}
else if (irreading < 135)
{
digitalWrite(motor1dir, HIGH);
analogWrite(motor1speed, 200);
}*/
if(state)
{
motorForward();
} else {
motorBackward();
}
state = !state;
delayTime = random(4500, 10000);
delay(delayTime);
}
void motorForward()
{
digitalWrite(motor1dir, LOW);
analogWrite(motor1speed, 200);
}
void motorBackward()
{
digitalWrite(motor1dir, HIGH);
analogWrite(motor1speed, 500);
}
Sunday, November 1, 2009
process of construction
I used a few tubes of superglue to cement the support frames onto the spacers. I made sure to only stick two large components together at a time as i wanted to be able to control the friction as best as possible when configuring it.
Laser cutting
I cut out lots of the five different components i needed to make up the bot.
3 Fins to each segment.
2 Stoppers between each segment to work as a stop for the fin flicking over.
short segment 1
long segment 2 (these were off centered from each other to make it more layered
spacing segment which sat between each part.
freehand model development.
New model
After a long period of time rakking my brain over how to create my spring loaded tube i changed my scheme to something which worked on the horizontal plane.My new concept is base on the simple mechanics of the mousetrap. I want i to spring out in a rapid motion envoking being startled.
I modeled up test on freehand and printed off a couple of ribs on the laser cutter and tested out the scheme by using a modified rat trap as the test rig.
Subscribe to:
Posts (Atom)






