RealTime Acc

Published on January 2017 | Categories: Documents | Downloads: 84 | Comments: 0 | Views: 887
of 1
Download PDF   Embed   Report

Comments

Content

int x = 0;
int row - 0;
const int xpin = 0; // analog input pins
const int ypin = 1;
const int zpin = 2;
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600
Serial.printin("CLEARDATA");
Serial.printin("LABEL,x,y,z");
}
void loop() {
row++;
x++;
int xValue; // value from accelerometer stored here
int yValue;
int zValue;
xValue = analogRead(xPin);
yValue = analogRead(yPin);
zValue = analogRead(zpin);
Serial.print("DATA,TIME,"); serial.print(xValue); serial.print
delay(100);
if (row > 298)
{
row=0;
Serial.printin("ROW,SET,2");
}
}

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close