Vex Accelerometer & EasyC

Hey guys

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:

  1. 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?

  1. 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!

  1. Correct so you will need to call Start Accel 3 times if you want x,y,z

  2. You can just stop sampling the accelerometer if the Joystick Axis is within some threshold as we return the raw data no accumulated data.

Good Luck, this will be a tricky task.