Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

irpair.h

Committer:
vanshg
Date:
2017-05-06
Revision:
10:810d1849da9d
Parent:
9:1d8e4da058cd
Child:
24:e7063765d6f0

File content as of revision 10:810d1849da9d:

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



#endif