Friday, May 11, 2012
Week 5 Progress Report
Accelerometers have arrived we have soldered them to fit our needs and be easily attached and detached from our Arduino. Preliminary coding has begun for the Accelerometers that will allow us to read the neccessary data as well as re calibrate and everything else that is required for full functionality of the sensors. Unfortunately there has a been a problem with the pulse sensors as the company failed to deliver them so we are unable to work on those as of now but we are actively looking for a solution to the problem by contacting the company.
Subscribe to:
Post Comments (Atom)
Here is the code we used to read and test the accelerometers:
ReplyDelete************************************************
int xPin = A2; // select the input pin for the potentiometer
int yPin = A1;
int zPin = A0;
int ledPin = 13; // select the pin for the LED
int xVal = 0;
int yVal = 0;
int zVal = 0; // variable to store the value coming from the sensor
void setup() {
// declare the ledPin as an OUTPUT:
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
// read the value from the sensor:
xVal = analogRead(xPin);
yVal = analogRead(yPin);
zVal = analogRead(zPin);
Serial.println("Accelerometer Values");
Serial.print("x = ");
Serial.println(xVal);
Serial.print("y = ");
Serial.println(yVal);
Serial.print("z = ");
Serial.println(zVal);
delay(500);
}
************************************************