First Commit IR remote class This class constructer needs (PwmOutPin,DigitalInPin,data array pointer,data array length,Serial instance pointer)
Diff: IRremote.h
- Revision:
- 0:fc05497b2a23
diff -r 000000000000 -r fc05497b2a23 IRremote.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/IRremote.h Sun Apr 06 09:12:22 2014 +0000 @@ -0,0 +1,32 @@ +#ifndef MBED_IRREMOTE_H +#define MBED_IRREMOTE_H +#include "mbed.h" +#include "debug.h" + +class IRremote +{ +public: + IRremote(PinName trans,PinName receive,int* point,int length,Serial* device); + void setArray(int* point,int length); + void showArray(); + int sum(); + float average(); + int datalength(); + void trans(void (*afunc)(void),void (*bfunc)(void)); + void receive(void (*afunc)(void),void (*bfunc)(void)); +protected: + void init(); + int* _point; + int _length; + int _sum; + float _ave; + PwmOut _trans; + DigitalIn _receive; + Timer _timer; + Serial* _device; + struct { + unsigned lastStatus : 1; + } flag; +}; + +#endif \ No newline at end of file