Infrared Rays library
See http://developer.mbed.org/users/yasuyuki/notebook/IRmbed/
Diff: IR.h
- Revision:
- 1:71ca050c4d05
- Parent:
- 0:c74b212c3cbf
--- a/IR.h Thu Jun 26 13:56:36 2014 +0000
+++ b/IR.h Fri Sep 25 17:11:16 2015 +0000
@@ -1,7 +1,7 @@
//**********************
// IR.h for mbed
//
-// (C)Copyright 2014 All rights reserved by Y.Onodera
+// (C)Copyright 2014-2015 All rights reserved by Y.Onodera
// http://einstlab.web.fc2.com
//**********************
@@ -9,24 +9,33 @@
#define IR_H_
#include "mbed.h"
+#define IR_LIMITS 64 // bytes buffer = IR_LIMITS x8 bits
+#define AEHA 19
+#define NEC 22
+#define SONY 23
class IR{
public:
- IR (PinName irin);
+ IR (PinName irin, PinName irin);
void init();
- unsigned char CountHigh();
- unsigned char CountLow();
- void GetIR2();
- void GetIR();
-
- unsigned char buf[16]; // max 128bits
- unsigned char mode; // 0:NEC, 1:STD
- unsigned char bits;
+ unsigned char countHigh();
+ unsigned char countLow();
+ void getIR2();
+ void getIR();
+ void outON(char n, char t);
+ void outOFF(char n, char t);
+ void setIR();
+
+ unsigned char buf[IR_LIMITS]; // bytes buffer
+ unsigned char mode; // 1:NEC, 2:AEHA, 3:SONY
+ unsigned short bits; // 32768 bits capable
protected:
DigitalIn _irin;
+ DigitalOut _irout;
+
};