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!


Revision of Lab 6 from Fri, 10/12/2007 - 22:21

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
}


Powered by Drupal - Design by Artinet