Generates reference based on analog input
Dependents: locomotion_pid_action_refactor_EMG
refGen.h@2:35c05e7698f5, 2017-10-20 (annotated)
- Committer:
- tvlogman
- Date:
- Fri Oct 20 12:23:03 2017 +0000
- Revision:
- 2:35c05e7698f5
- Parent:
- 1:ac2d82dfd334
- Child:
- 3:43d9f8db93b7
Made maxAngle and r_direction members of refGen;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tvlogman | 0:5c67195a412d | 1 | #ifndef REFGEN_H |
tvlogman | 0:5c67195a412d | 2 | #define REFGEN_H |
tvlogman | 0:5c67195a412d | 3 | |
tvlogman | 0:5c67195a412d | 4 | #include "mbed.h" |
tvlogman | 0:5c67195a412d | 5 | |
tvlogman | 2:35c05e7698f5 | 6 | |
tvlogman | 0:5c67195a412d | 7 | class refGen { |
tvlogman | 0:5c67195a412d | 8 | public: |
tvlogman | 0:5c67195a412d | 9 | refGen(PinName); // Constructor sets up the pin to read the reference from |
tvlogman | 0:5c67195a412d | 10 | float getReferencePosition(float maxAngle, bool r_direction); // Gets reference position on specified pin |
tvlogman | 2:35c05e7698f5 | 11 | float maxAngle; |
tvlogman | 2:35c05e7698f5 | 12 | bool r_direction; |
tvlogman | 0:5c67195a412d | 13 | |
tvlogman | 0:5c67195a412d | 14 | private: |
tvlogman | 0:5c67195a412d | 15 | AnalogIn refPin; |
tvlogman | 0:5c67195a412d | 16 | }; |
tvlogman | 0:5c67195a412d | 17 | #endif |