int main() { float power = power_level(); //test running for 2 minutes int i=0; int clawPort = 0; int clawMin = 660; int clawMax = 1000; enable_servos(); //open claws to start set_servo_position(clawPort, clawMin); msleep(500); for(i=0;i<1;i++){ drive(50); s(1); drive(-50); s(1); drive(0); movePipe(1,1); //close claws set_servo_position(clawPort, clawMax); msleep(500); //open claws set_servo_position(clawPort, clawMin); msleep(500); //close claws set_servo_position(clawPort, clawMax); msleep(500); movePipe(1,-1); } disable_servos(); ao(); //end test for 2 minutes power = power_level(); return 0; }
side methods not listed
when this program runs (mainly to check battery level), the level actually goes up.. and it's in a huge number range.
what's the best way to get the brick's battery level? the 'home page' of the brick is very weird, when we plug in the charger the level just bumps up like 20%
To print out a floating type you need to use %f and not %d. I think that's the issue.
You need to use %f instead of %d when using a float. I think that's the issue.