Updates error values

Dependents:   locomotion_pid_action_refactor_EMG

Committer:
tvlogman
Date:
Sun Oct 22 08:01:40 2017 +0000
Revision:
3:71a7dd98fb2c
Parent:
2:d22c458a8a78
Child:
4:2af658a4e54b
Changed so errorFetch no longer requires  a refGen object but instead takes a reference value as a parameter - clarity and seperation of concerns;

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
tvlogman 0:cb9eda46a58c 7 class errorFetch {
tvlogman 0:cb9eda46a58c 8 public:
tvlogman 2:d22c458a8a78 9 errorFetch(float, float); // Constructor sets up the pin to read the reference from
tvlogman 0:cb9eda46a58c 10 volatile float e_pos;
tvlogman 0:cb9eda46a58c 11 volatile float e_int;
tvlogman 0:cb9eda46a58c 12 volatile float e_der;
tvlogman 0:cb9eda46a58c 13 volatile float e_prev;
tvlogman 0:cb9eda46a58c 14
tvlogman 2:d22c458a8a78 15 void fetchError(int counts, float ref); // Gets reference position on specified pin
tvlogman 0:cb9eda46a58c 16
tvlogman 0:cb9eda46a58c 17 private:
tvlogman 0:cb9eda46a58c 18 const float gearRatio;
tvlogman 0:cb9eda46a58c 19 const float Ts;
tvlogman 0:cb9eda46a58c 20 };
tvlogman 0:cb9eda46a58c 21 #endif