by l3v3rz » Sun May 15, 2011 6:10 pm
by l3v3rz
Sun May 15, 2011 6:10 pm
Call the function
- Code: Select all
void Acc_init(void)
And then every time you want to get a accelerometer reading call
- Code: Select all
void AccGetData(void)
The X,Y,Z values are available in the global variables gAccX ,gAccY ,gAccZ. Now check those values continuously in a loop and if the value of Z is in a certain range call the predefined motion - such as stand up. See the IR controller code to see how to call a predefined motion when a button is pressed.
cheers
Call the function
- Code: Select all
void Acc_init(void)
And then every time you want to get a accelerometer reading call
- Code: Select all
void AccGetData(void)
The X,Y,Z values are available in the global variables gAccX ,gAccY ,gAccZ. Now check those values continuously in a loop and if the value of Z is in a certain range call the predefined motion - such as stand up. See the IR controller code to see how to call a predefined motion when a button is pressed.
cheers