# accelerometer tutorial

Hi Everyone, my second time here?.no luck in the Spanish forum. So with my weird English I decided to come here…
I’m doing the accelerometer tutorial?everything works great arduino and the accelerometer is measuring?But my problem it is that I can’t understand some of the code of the tutorial
The colorful part of the code is the thing’s I don’t know what is referring to.
If anyone has the time to explain will be great.
what I wanted to do if anyone is interested…I’m trying to mesuare velocity, distance…etc using different equations.
Please have a moment to look this! int ledPin = 13;
int xaccPin = 7;
int yaccPin = 6;
int value = 0;
int accel = 0;
char sign = ’ ';

int timer = 0;
int count = 0;

void setup() {
beginSerial(9600);
pinMode(ledPin, OUTPUT);
pinMode(xaccPin, INPUT);
pinMode(yaccPin, INPUT);
}

int operateAcceleration(int time1) {
return abs(8 * (time1 / 10 - 500));
} // I don’t know what this equation is…can anyone explain a bit

timer = 0;
count = 0;
while(value == HIGH) {
}
while(value == LOW) {
}
while(value == HIGH) { /
count = count + 1;
}
timer = count * 18; // here I don’t know what is 18? can anyone explain me this?
if (timer > 5000){
sign = ‘+’;
}
if (timer < 5000){
sign = ‘-’;
} // here I’ don’t get what is 5000 ?
//determine the value
accel = operateAcceleration(timer);

//Represent acceleration over serial port
if (axe == 7){
printByte(‘X’);
}
else {
printByte(‘Y’);
}
printByte(sign);
printInteger(accel);
printByte(’ ');

}
void loop() {