I am currently trying to configure the vex accelerometer which main function is to detect slip in the robot and compensate for it. Basically, what I am trying to do is have the drive motors of the robot to kick on when its current position falls behind its last known position (slipping condition), and stop once it corrects for it.
I am still relatively new to easyC, so pardon some of my lingo.
Two main questions:
- in easyC how does one call out the independent axis on the accelerometer? I understand the GetAcceleration function grabs all x, y and z, but how do I isolate the axis individually?
-edit- it seems like each independent axis is connected to a different analog port, and all I have to do is call out the port it is connected to on the vex cortex microcontroller… is this correct?
- the robot is able to move backwards / forwards also, but I’m afraid that it would get it confused with a slipping condition. is it possible to stop the accelerometer code when there is input from the joysticks? an interrupt function maybe?
Thanks for any input!