How to use brain battery command?

I’m trying to print the brain battery to the controller as well as other info about my robot. From the API it says the command for getting the battery percentage is vex::brain::battery::capacity but I have no idea how to use it. Any help would be appreciated.

yea, the API docs leave a lot to be desired.
There’s already an instance of the brain class created with most VEXcode projects, so all you need is.

int32_t capacity;
capacity = Brain.Battery.capacity();

and use the returned value.

3 Likes