Updates error values

Dependents:   locomotion_pid_action_refactor_EMG

errorFetch.h

Committer:
tvlogman
Date:
2017-10-20
Revision:
1:9e2c9237d88b
Parent:
0:cb9eda46a58c
Child:
2:d22c458a8a78

File content as of revision 1:9e2c9237d88b:

#ifndef ERRORFETCH_H
#define ERRORFETCH_H

#include "mbed.h"
#include "QEI.h"
#include "refGen.h"

class errorFetch {
public:
    errorFetch(refGen, float, float); // Constructor sets up the pin to read the reference from
    volatile float e_pos;
    volatile float e_int;
    volatile float e_der;
    volatile float e_prev;
    
    void fetchError(int counts); // Gets reference position on specified pin
    refGen ref;
    
private:
    const float gearRatio;
    const float Ts;
    };
#endif