Updates error values

Dependents:   locomotion_pid_action_refactor_EMG

errorFetch.h

Committer:
tvlogman
Date:
2017-10-22
Revision:
2:d22c458a8a78
Parent:
1:9e2c9237d88b
Child:
3:71a7dd98fb2c

File content as of revision 2:d22c458a8a78:

#ifndef ERRORFETCH_H
#define ERRORFETCH_H

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

class errorFetch {
public:
    errorFetch(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, float ref); // Gets reference position on specified pin
    
private:
    const float gearRatio;
    const float Ts;
    };
#endif