Prototyp V2
Dependencies: PM2_Libary
Diff: main.cpp
- Branch:
- lupo
- Revision:
- 36:6116ce98080d
- Parent:
- 35:f02adb2c2b8a
- Child:
- 47:8963ca9829b9
--- a/main.cpp Wed Apr 13 09:40:22 2022 +0200 +++ b/main.cpp Tue Apr 19 15:03:27 2022 +0200 @@ -66,6 +66,9 @@ int ToNextFunction = 0; float max_speed_rps = 0.5f; +extern double powerx(double base, double pow2); +extern double mapping (float adc_value_mV); + int StartPosition(float deg){ positionController_M_Arm.setDesiredRotation(deg); @@ -86,7 +89,6 @@ return 0; } - //only turns the arm until the robot is on the next step //not yet clear if the motor controler function drives to a absolute poition or if it drives the given distance relative to the current position int LiftUp(float deg){ @@ -100,22 +102,26 @@ } + + int main(void) { // attach button fall and rise functions to user button object user_button.fall(&user_button_pressed_fcn); user_button.rise(&user_button_released_fcn); - + printf("Power of%3.3f\n", powerx(2, 2)); while (true){ enable_motors = 1; ir_distance_mV = 1.0e3f * ir_analog_in.read() * 3.3f; + printf("test pow function 2 ^ 2 %lf\n",powerx(2,2)); printf("test mapping function %f\n", mapping(ir_distance_mV)); + //printf("IR sensor (mV): %3.3f\n", ir_distance_mV);