Updates error values

Dependents:   locomotion_pid_action_refactor_EMG

errorFetch.h

Committer:
tvlogman
Date:
2017-10-22
Revision:
3:71a7dd98fb2c
Parent:
2:d22c458a8a78
Child:
4:2af658a4e54b

File content as of revision 3:71a7dd98fb2c:

#ifndef ERRORFETCH_H
#define ERRORFETCH_H

#include "mbed.h"
#include "QEI.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