Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

USE ACCELERATION SENSOR

Korean company maker of Robot kits and servos designed for of articulated robots. Re-incarnation of Megarobotics.
5 postsPage 1 of 1
5 postsPage 1 of 1

USE ACCELERATION SENSOR

Post by Ben Rubi » Sat May 14, 2011 10:32 pm

Post by Ben Rubi
Sat May 14, 2011 10:32 pm

HI ALL
IF ANYONE HAVE EXPLANATION HOW TO PROGRAM IN C LANGUAGE THE ROBOBUILDER TO USE ACCELERATION SENSOR AND TO GET UP WHEN ITS FALL DOWN?
THANK YOU
HI ALL
IF ANYONE HAVE EXPLANATION HOW TO PROGRAM IN C LANGUAGE THE ROBOBUILDER TO USE ACCELERATION SENSOR AND TO GET UP WHEN ITS FALL DOWN?
THANK YOU
Ben Rubi
Robot Builder
Robot Builder
Posts: 7
Joined: Mon Mar 21, 2011 8:51 pm

Post by l3v3rz » Sun May 15, 2011 11:34 am

Post by l3v3rz
Sun May 15, 2011 11:34 am

If you look in the file http://robosavvy.com/RoboSavvyPages/Rob ... Source.zip you'll find accel.c that has the source to read the accelerometer.
If you look in the file http://robosavvy.com/RoboSavvyPages/Rob ... Source.zip you'll find accel.c that has the source to read the accelerometer.
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by Ben Rubi » Sun May 15, 2011 5:42 pm

Post by Ben Rubi
Sun May 15, 2011 5:42 pm

thank you for your answer but i need explanation how to use it. yes i see the function but i don't know how to work with it. i read all the pdf file that attached to to source but its not mentioned there.
thank you for your answer but i need explanation how to use it. yes i see the function but i don't know how to work with it. i read all the pdf file that attached to to source but its not mentioned there.
Ben Rubi
Robot Builder
Robot Builder
Posts: 7
Joined: Mon Mar 21, 2011 8:51 pm

Post by l3v3rz » Sun May 15, 2011 6:10 pm

Post 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
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by Ben Rubi » Sun May 15, 2011 6:21 pm

Post by Ben Rubi
Sun May 15, 2011 6:21 pm

Thank you very much :D
Thank you very much :D
Ben Rubi
Robot Builder
Robot Builder
Posts: 7
Joined: Mon Mar 21, 2011 8:51 pm


5 postsPage 1 of 1
5 postsPage 1 of 1