Updates error values

Dependents:   locomotion_pid_action_refactor_EMG

Committer:
tvlogman
Date:
Fri Oct 20 16:29:30 2017 +0000
Revision:
1:9e2c9237d88b
Parent:
0:cb9eda46a58c
Child:
2:d22c458a8a78
Now working, takes an input parameter counts instead of defining its own QEI encoder

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tvlogman 0:cb9eda46a58c 1 #ifndef ERRORFETCH_H
tvlogman 0:cb9eda46a58c 2 #define ERRORFETCH_H
tvlogman 0:cb9eda46a58c 3
tvlogman 0:cb9eda46a58c 4 #include "mbed.h"
tvlogman 0:cb9eda46a58c 5 #include "QEI.h"
tvlogman 0:cb9eda46a58c 6 #include "refGen.h"
tvlogman 0:cb9eda46a58c 7
tvlogman 0:cb9eda46a58c 8 class errorFetch {
tvlogman 0:cb9eda46a58c 9 public:
tvlogman 1:9e2c9237d88b 10 errorFetch(refGen, float, float); // Constructor sets up the pin to read the reference from
tvlogman 0:cb9eda46a58c 11 volatile float e_pos;
tvlogman 0:cb9eda46a58c 12 volatile float e_int;
tvlogman 0:cb9eda46a58c 13 volatile float e_der;
tvlogman 0:cb9eda46a58c 14 volatile float e_prev;
tvlogman 0:cb9eda46a58c 15
tvlogman 1:9e2c9237d88b 16 void fetchError(int counts); // Gets reference position on specified pin
tvlogman 0:cb9eda46a58c 17 refGen ref;
tvlogman 0:cb9eda46a58c 18
tvlogman 0:cb9eda46a58c 19 private:
tvlogman 0:cb9eda46a58c 20 const float gearRatio;
tvlogman 0:cb9eda46a58c 21 const float Ts;
tvlogman 0:cb9eda46a58c 22 };
tvlogman 0:cb9eda46a58c 23 #endif