// 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.
Sunday, October 11, 2009
materials collection.
We have airsoft rifles at my flat and we 'battle' with them.
http://www.youtube.com/watch?v=RIJqPs7btFA

.JPG)
I pulled apart the gun to see how this mechanism works. The gun pulls through a chamber of air when the lever is pushed down. It is then stored until the trigger is set off. I will attempt to mimic this mechanism.
I have been to the dump on three occasions now. I have been looking for old pressurized systems with valves. This will be used instead of springs to 'cock' my mechanism ready for the next 'fright.'
I collected an old coffee grinder which turned out to run off dc power, it was a bit on the dodgy side...
I collected an old 1985 nintendo 'zapper', it is a light emitting gun which was used for point and shoot games using crt monitors,

quoted from wiki:
When the trigger on the Zapper is
pressed, the game causes the entire screen to become black for one frame. Then, on the next frame, the first target area is drawn in all white as the rest of the screen remains black. On t
he next frame, the next target
area is
drawn in white. The Zapper detects this change from low light to
bright light, as well as which frame the change was detected. This is how the game knows which target has been hit. After
all target areas have been illuminated, the game returns to drawing graphics as usual. The whole process is almost imperceptible to the human eye.
I was hoping to use the light emmitter as a trigger. I need to do some more research into it.
I also uncovered a well used rc car without the remote control.
There are some good parts to salvage from it including an AC motor which is hooked up to a drivetrain. The front steering arms could well work as a switch. and its a good base to get my head into figuring out how all the electronics work within it.
Subscribe to:
Posts (Atom)






