Description
I had a hard time with this project because I felt limited with the motor's rotational functionality (that it only spins things was a problem as I don't have enough design experience to be able to translate that rotation into different kinds of motion--at least nothing more interesting than what we did in lab). As a result, and because I'm behind in my postings, I decided to go head and experiment with making objects vibrate. Using spirit gum and tape, I carefully suspended the DC motor (and coark from lab) on the inside of this week's servo motor box. I also changed the input device, replacing the POT with the force sensor, so that vibration wouldn't get out of hand. Otherwise the code stayed the same from our lab. While this project seems simple (and it is), it has allowed me to get an idea of the challenges involved with trying to get something designed to vibrate to fit inside another component, and to stay there. More than once my design was shaken apart, which was frustrating, but a good experience.
Components Used
Breadboard, many wires, DC Motor, diode, two transistors, arduino board, 2 AA batteries, 2 rubber bands, spirit gum, tape, Futaba box, force sensor.
Code
/*
* one pot fades one motor
* modified version of AnalogInput
* by DojoDave <http://www.0j0.org>
* http://www.arduino.cc/en/Tutorial/AnalogInput
* Modified again by dave
*/
int potPin = 0; // select the input pin for the potentiometer
int motorPin = 9; // select the pin for the Motor
int val = 0; // variable to store the value coming from the sensor
void setup() {
Serial.begin(9600);
}
void loop() {
val = analogRead(potPin); // read the value from the sensor, between 0 - 1024
Serial.println(val);
analogWrite(motorPin, val/4); // analogWrite can be between 0-255
}
Images
Comments
Comments from TAs
Experimenting with different affordances of inputs and outputs can be very worthwhile, because it gives you a feel for how things work and what types of possibilities they open up for you. Given your focus on experimenting with making things vibrate, it would be great if you could discuss a little more about what worked well and what didn't. I'm sure others in the class would benefit from your ideas!