Infrared Rays library
See http://developer.mbed.org/users/yasuyuki/notebook/IRmbed/
IR.h@0:c74b212c3cbf, 2014-06-26 (annotated)
- Committer:
- yasuyuki
- Date:
- Thu Jun 26 13:56:36 2014 +0000
- Revision:
- 0:c74b212c3cbf
- Child:
- 1:71ca050c4d05
first revision
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yasuyuki | 0:c74b212c3cbf | 1 | //********************** |
yasuyuki | 0:c74b212c3cbf | 2 | // IR.h for mbed |
yasuyuki | 0:c74b212c3cbf | 3 | // |
yasuyuki | 0:c74b212c3cbf | 4 | // (C)Copyright 2014 All rights reserved by Y.Onodera |
yasuyuki | 0:c74b212c3cbf | 5 | // http://einstlab.web.fc2.com |
yasuyuki | 0:c74b212c3cbf | 6 | //********************** |
yasuyuki | 0:c74b212c3cbf | 7 | |
yasuyuki | 0:c74b212c3cbf | 8 | #ifndef IR_H_ |
yasuyuki | 0:c74b212c3cbf | 9 | #define IR_H_ |
yasuyuki | 0:c74b212c3cbf | 10 | |
yasuyuki | 0:c74b212c3cbf | 11 | #include "mbed.h" |
yasuyuki | 0:c74b212c3cbf | 12 | |
yasuyuki | 0:c74b212c3cbf | 13 | class IR{ |
yasuyuki | 0:c74b212c3cbf | 14 | public: |
yasuyuki | 0:c74b212c3cbf | 15 | IR (PinName irin); |
yasuyuki | 0:c74b212c3cbf | 16 | void init(); |
yasuyuki | 0:c74b212c3cbf | 17 | |
yasuyuki | 0:c74b212c3cbf | 18 | unsigned char CountHigh(); |
yasuyuki | 0:c74b212c3cbf | 19 | unsigned char CountLow(); |
yasuyuki | 0:c74b212c3cbf | 20 | void GetIR2(); |
yasuyuki | 0:c74b212c3cbf | 21 | void GetIR(); |
yasuyuki | 0:c74b212c3cbf | 22 | |
yasuyuki | 0:c74b212c3cbf | 23 | unsigned char buf[16]; // max 128bits |
yasuyuki | 0:c74b212c3cbf | 24 | unsigned char mode; // 0:NEC, 1:STD |
yasuyuki | 0:c74b212c3cbf | 25 | unsigned char bits; |
yasuyuki | 0:c74b212c3cbf | 26 | |
yasuyuki | 0:c74b212c3cbf | 27 | protected: |
yasuyuki | 0:c74b212c3cbf | 28 | |
yasuyuki | 0:c74b212c3cbf | 29 | DigitalIn _irin; |
yasuyuki | 0:c74b212c3cbf | 30 | |
yasuyuki | 0:c74b212c3cbf | 31 | }; |
yasuyuki | 0:c74b212c3cbf | 32 | |
yasuyuki | 0:c74b212c3cbf | 33 | |
yasuyuki | 0:c74b212c3cbf | 34 | #endif /* IR_H_ */ |