MakeBlock Drive Updated Updated library for MakeBlock Ranger

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
MeIR Class Reference

Driver for Me IR module. More...

`#include <src/MeIR.h>`

## Public Member Functions
| MeIR ()
ErrorStatus | decode ()
void | begin ()
void | end ()
void | loop ()
boolean | keyPressed (unsigned char r)
String | getString ()
unsigned char | getCode ()
void | sendString (String s)
void | sendString (float v)
void | sendNEC (unsigned long data, int nbits)
void | sendRaw (unsigned int buf[], int len, uint8_t hz)
void | enableIROut (uint8_t khz)
void | enableIRIn ()
void | mark (uint16_t us)
void | space (uint16_t us)

## Public Attributes
int8_t | decode_type
unsigned long | value
uint8_t | bits
volatile uint8_t * | rawbuf
int | rawlen

## Detailed Description

Driver for Me IR module.

Class: MeIR

Description
  Declaration of Class MeIR.

Copyright (C), 2012-2016, MakeBlock

## Constructor & Destructor Documentation

## ◆ MeIR()

MeIR::MeIR | ( |  | ) |

Alternate Constructor which can call your own function to map the IR to arduino port, no pins are used or initialized here.

Parameters

  [in] | None |

## Member Function Documentation

## ◆ begin()

void MeIR::begin | ( |  | ) |

Function
  begin

Description
  Initialize interrupt.

Parameters

  [in] | None |

Output
  None

Return
  None

Others
  None

## ◆ decode()

ErrorStatus MeIR::decode | ( |  | ) |

Function
  decode

Description
  Decodes the received IR message.

Parameters

  [in] | None |

Output
  None

Return
  Returns 0 if no data ready, 1 if data ready.

Others
  Results of decoding are stored in results.

## ◆ enableIRIn()

void MeIR::enableIRIn | ( |  | ) |

Function
  enableIRIn

Description
  Enable an IR to write in.

Parameters

  [in] | None |

Output
  None

Return
  None

Others
  None

## ◆ enableIROut()

void MeIR::enableIROut | ( | uint8_t | khz | ) |

Function
  enableIROut

Description
  Enable an IR for the specified number of khz.

Parameters

  [in] | us | - THe time of a INTR.

Output
  None

Return
  None

Others
  None

## ◆ end()

void MeIR::end | ( |  | ) |

Function
  end

Description
  Close the interrupt.

Parameters

  [in] | None |

Output
  None

Return
  None

Others
  None

## ◆ getCode()

unsigned char MeIR::getCode | ( |  | ) |

Function
  getCode

Description
  Get the reading code.

Parameters

  [in] | None |

Output
  None

Return
  Return the result of reading.

Others
  None

## ◆ getString()

String MeIR::getString | ( |  | ) |

Function
  getString

Description
  Get string in a INTR.

Parameters

  [in] | None |

Output
  None

Return
  Return the result in a IRQ.

Others
  None

## ◆ keyPressed()

boolean MeIR::keyPressed | ( | unsigned char | r | ) |

Function
  keyPressed

Description
  Press key.

Parameters

  [in] | None |

Output
  None

Return
  Return you the pressed key or not.

Others
  None

## ◆ loop()

void MeIR::loop | ( |  | ) |

Function
  loop

Description
  A circle of operation.

Parameters

  [in] | None |

Output0
  None

Return
  None

Others
  None

## ◆ mark()

void MeIR::mark | ( | uint16_t | us | ) |

Function
  mark

Description
  Sends an IR mark for the specified number of microseconds.

Parameters

  [in] | us | - THe time of a PWM.

Output
  None

Return
  None

Others
  None

## ◆ sendNEC()

void MeIR::sendNEC | ( | unsigned long | data,
|  | int | nbits
| ) |  |

Function
  sendNEC

Description
  Send NEC.

Parameters

  [in] | data | - The data you want to send.
  [in] | nbits | - The data bit you want to send.

Output
  None

Return
  None

Others
  None

## ◆ sendRaw()

void MeIR::sendRaw | ( | unsigned int | buf[],
|  | int | len,
|  | uint8_t | hz
| ) |  |

Function
  sendRaw

Description
  Send the length of data with hz.

Parameters

  [in] | buf[] | - The data's buffer.
  [in] | len | - The data's length.
  [in] | hz | - The hz for sending data.

Output
  None

Return
  None

Others
  None

## ◆ sendString() [1/2]

void MeIR::sendString | ( | float | v | ) |

Function
  sendString

Description
  Send data.

Parameters

  [in] | v | - The string you want to send.

Output
  None

Return
  None

Others
  None

## ◆ sendString() [2/2]

void MeIR::sendString | ( | String | s | ) |

Function
  sendString

Description
  Send data.

Parameters

  [in] | s | - The string you want to send.

Output
  None

Return
  None

Others
  None

## ◆ space()

void MeIR::space | ( | uint16_t | us | ) |

Function
  space

Description
  Sends an IR mark for the specified number of microseconds.

Parameters

  [in] | us | - THe time of a PWM.

Output
  None

Return
  None

Others
  None

The documentation for this class was generated from the following file:

- src/MeIR.h