Cleaned up the code a bit
Dependencies: mbed QEI HIDScope biquadFilter MODSERIAL FastPWM
Diff: main.cpp
- Revision:
- 4:7640f5dd9375
- Parent:
- 3:46da963e60fb
- Child:
- 5:4530cd699129
--- a/main.cpp Mon Oct 14 13:16:46 2019 +0000 +++ b/main.cpp Mon Oct 14 13:24:22 2019 +0000 @@ -35,10 +35,9 @@ #define M_PI acos(-1.0) const float to_rads =(2*M_PI); //2*Pi volatile int counts_1 = 0; // counts of Encoder_1 -volatile int revolutions_1 = 0; // revolutions of Motor_1 const float CountsPerRevolution = 8400; // counts of the encoder per revolution (Property of motor) -const float GearRatio = 131.25; // GearRatio(Property of motor) -const float ShaftResolution = (GearRatio * to_rads)/ (4*CountsPerRevolution); // calculates constant for relation between counts and radians (rad/count) +//const float GearRatio = 131.25; // GearRatio(Property of motor) +const float ShaftResolution = (to_rads)/(CountsPerRevolution); // calculates constant for relation between counts and radians (rad/count) // FUNCTIONS float GetValueFromKeyboard() //Gets input from PC @@ -104,7 +103,6 @@ start_main: pc.printf("counts_1 = %i\r\n", counts_1); - pc.printf("revolutions_1 = %i\r\n", revolutions_1); wait(0.5); @@ -117,7 +115,6 @@ { counts_1 = Encoder_1.getPulses(); Enc_1psi(); - revolutions_1 = Encoder_1.getRevolutions(); MOTOR_1(); if (but_1 == 0) {