Announcements

November 24, 2007
Reading for November 27th, are now posted. Enjoy!

October 2, 2007
To upload your thoughtless acts, create a new assignment page like any other lab. You'll see "Thoughtless Acts" listed as one of the assignment options.

May 24, 2008
This site has been archived and is no longer editable. Stay tuned for the next version, coming in the fall!


Lab 6

Project Members: 
Kimberly_Lau

Description

I created a fan that spins with input from the pressure sensor. It can spin fast or slow, depending on how hard you press down. Woot!

Components

Arduino board
Breadboard
One 1-kohm resistor
1 FSR
Arduino Code
Tape and cool paper

Arduino Code

 

http://www.arduino.cc/en/Tutorial/AnalogInput
* Modified again by Kimberly Lau
*/

int FSRPin = 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(FSRPin); // read the value from the sensor, between 0 - 1024
Serial.println(val);
analogWrite(motorPin, val/4); // analogWrite can be between 0-255
}

 

picpic


Comments

Comments from TAs

Cool fan (literally!). Squeezing a fan to speed it up is an interesting interaction. It would be good to think about what kind of physical form might mesh well with such a fan. For example, would you have a spring-loaded handle that could be squeezed to turn on the fan? After you squeezed, would the fan stay on, or would you have to keep squeezing (and potentially get tired)? Now that building things with Arduino is getting easier, it's important to think about these other issues.


Powered by Drupal - Design by Artinet