Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

irpair.h

Committer:
kyleliangus
Date:
2017-05-05
Revision:
8:a0760acdc59e
Parent:
6:3d68fedd6fd9
Child:
9:1d8e4da058cd

File content as of revision 8:a0760acdc59e:

#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();
        }
        
        float getSamples( int i );
        
    private:
        void calibrateSensor();
        
        // internal values
        DigitalOut ir;
        AnalogIn recv;
        float sensorAvg;
};



#endif