Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

irpair.h

Committer:
sahilmgandhi
Date:
2017-06-03
Revision:
46:b156ef445742
Parent:
33:68ce1f74ab5f

File content as of revision 46:b156ef445742:

#ifndef IRPAIR_H
#define IRPAIR_H

#include "mbed.h"

#define samplesToTake 1000

class IRPair
{
    public:
        IRPair( PinName pin, PinName rec ) : ir( pin ), recv( rec )
        {
            calibrateSensor();
        }
        
        double getSamples( int samples );
        
        float sensorAvg;
        void calibrateSensor();
        
    private:
        
        
        // internal values
        DigitalOut ir;
        AnalogIn recv;
        
};



#endif