Essentially this system measures the intensity and passion of a high five. The glove is retrofitted with an FSR, the body of the motor has been secured to a tripod stand and its rotating arm to a slinky. The analogInput from the FSR decides the time and speed of the motor.
Please view video of the working product here:
https://www.sparkcamera.com/v/A1nwAliIaY
/*
* 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 fsrPin = 1;
int motorPin = 9; // select the pin for the Motor
int potVal = 0; // variable to store the value coming from the sensor
int fsrVal = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
potVal = analogRead(potPin); // read the value from the sensor, between 0 - 1024
fsrVal = analogRead(fsrPin);
//Serial.print("pot");
//Serial.println(potVal);
Serial.print("fsr");
Serial.println(fsrVal);
analogWrite(motorPin, fsrVal/4); // analogWrite can be between 0-255
if (fsrVal > 300) {
delay(fsrVal);
}
}
- Login to post comments