IRSendRev Class

IRSendRev Class

Description
A class used for managing, sending, and receiving data using IR.

Syntax
class IRSendRev

Members

Public Constructors 
The public constructor should not be used as this class is intended to be a singleton class.
Access member functions using the object instance named IR.
Public Methods 
IRSendRecv::InitInitialize the IRSendRecv class.
IRSendRecv::SendSend data using IR.
IRSendRecv::RecvReceive data using IR.
IRSendRecv::IsDtaCheck if data is received from IR.
IRSendRecv::ClearClear received data buffer.

IRSendRev::Init

Description
Initialize the IRSendRev class.

Syntax
void Init (int revPin);
void Init (void);

Parameters
revPin: pin used for receiving IR data.

Returns
NA

Example Code
Example: recv
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/IRSendRecv/examples/recv/recv.ino)

Notes and Warnings
revPin should be a pin that has interrupt functionality. “IRSendRev.h” must be included to use the class function.

IRSendRev::Send

Description
Send data using IR.

Syntax
void Send (unsigned char *idata, unsigned char ifreq);

Parameters
idata: pointer to data to send.
ifreq: IR modulation frequency in kilohertz (kHz).

Returns
NA

Example Code
Example: send
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/IRSendRecv/examples/send/send.ino)

Notes and Warnings
“IRSendRev.h” must be included to use the class function.

IRSendRev::Recv

Description
Receive data using IR.

Syntax
unsigned char Recv(unsigned char *revData);

Parameters
revData: pointer to the location for storing received data.

Returns
This function returns the total number of received bytes.

Example Code
Example: recv
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/IRSendRecv/examples/recv/recv.ino)

Notes and Warnings
“IRSendRev.h” must be included to use the class function.

IRSendRev::IsDta

Description
Check if data is received from IR.

Syntax
unsigned char IsDta (void);

Parameters
NA

Returns
This function returns “0” if no data received or received data is incomplete.

Example Code
Example: recv
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/IRSendRecv/examples/recv/recv.ino)

Notes and Warnings
“IRSendRev.h” must be included to use the class function.

IRSendRev::Clear

Description
Clear received data buffer.

Syntax
void Clear(void);

Parameters
NA

Returns
NA

Example Code
NA

Notes and Warnings
“IRSendRev.h” must be included to use the class function.

Please confirm that QQ communication software is installed
請先確認已安裝QQ通訊軟體