Generates reference based on analog input
Dependents: locomotion_pid_action_refactor_EMG
Diff: refGen.cpp
- Revision:
- 5:7186da6f562f
- Parent:
- 4:38af2aa14a3f
- Child:
- 6:a8a82cee2705
--- a/refGen.cpp Sun Oct 22 08:01:03 2017 +0000 +++ b/refGen.cpp Sun Oct 22 08:06:37 2017 +0000 @@ -1,6 +1,5 @@ #include "refGen.h" #include "mbed.h" -#include "biquadChain.h" // Member function definitions refGen::refGen(PinName a, float maxAngle):refPin(a), maxAngle(maxAngle), r_direction(false){ @@ -19,18 +18,4 @@ } return r; } - -float refGen :: getFilteredReference(biquadChain BQC){ - float r; - if(r_direction == false){ - // Clockwise rotation yields positive reference - r = maxAngle*refPin.read(); - r = BQC.applyFilter(r); - } - if(r_direction == true){ - // Counterclockwise rotation yields negative reference - r = -1*maxAngle*refPin.read(); - r = BQC.applyFilter(r); - } - return r; - } \ No newline at end of file + \ No newline at end of file