Generates reference based on analog input
Dependents: locomotion_pid_action_refactor_EMG
Diff: refGen.cpp
- Revision:
- 2:35c05e7698f5
- Parent:
- 0:5c67195a412d
- Child:
- 3:43d9f8db93b7
diff -r ac2d82dfd334 -r 35c05e7698f5 refGen.cpp --- a/refGen.cpp Mon Oct 16 09:40:22 2017 +0000 +++ b/refGen.cpp Fri Oct 20 12:23:03 2017 +0000 @@ -2,7 +2,7 @@ #include "mbed.h" // Member function definitions -refGen::refGen(PinName a):refPin(a){ +refGen::refGen(PinName a, float maxAngle):refPin(a), maxAngle(maxAngle), r_direction(false){ } @@ -10,7 +10,7 @@ float r; if(r_direction == false){ // Clockwise rotation yields positive reference - r = maxAngle*refPin.read(); + r = maxAngle*frefPin.read(); } if(r_direction == true){ // Counterclockwise rotation yields negative reference