Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

irled.h

Committer:
kyleliangus
Date:
2017-04-28
Revision:
5:7e1e4cc19044
Parent:
4:b5b7836ca2b0

File content as of revision 5:7e1e4cc19044:

#ifndef IRLED_H
#define IRLED_H

#include "mbed.h"

#define samplesToTake 1000

class IrLed
{
    public:
        IrLed( 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