Assignment: DC Motor: Actuation Assignment 1
Collaborators: tilman, davida
Description
Our idea was to create a paper plane. Thus we installed a propeller at the plane's nose. The speed of the propeller is controlled by a FSR sensor which is built into in the middle part of the plane. So the strength of the grip with which the 'pilot' is holding the plane determines the spin of the propeller.
Componentes Used
Source Code
/*
* @author: Tilman, David
* A built-in FSR controlls the speed of the plane's propeller
*/
int FSRPin = 5; // select the input pin for the FSR
int motorPin = 9; // select the pin for the propeller
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); // analogWrite can be between 0-255
}
Images