MakeBlock Drive Updated Updated library for MakeBlock Ranger

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

Driver for Me Infrared Receiver device. More...

`#include <src/MeInfraredReceiver.h>`

Inheritance diagram for MeInfraredReceiver:
[legend]
Collaboration diagram for MeInfraredReceiver:
[legend]

## Public Member Functions
| MeInfraredReceiver (void)
| MeInfraredReceiver (uint8_t port)
void | begin (void)
int | read ()
bool | buttonState (void)
uint8_t | getCode (void)
void | loop (void)
Public Member Functions inherited from MeSerial
| MeSerial (void)
| MeSerial (uint8_t port)
| MeSerial (uint8_t receivePin, uint8_t transmitPin, bool inverse_logic=false)
void | setHardware (bool mode)
void | begin (long baudrate)
size_t | write (uint8_t byte)
int | read ()
int | available ()
int16_t | poll (void)
void | end (void)
bool | listen (void)
bool | isListening (void)
void | sendString (char *str)
void | printf (char *fmt,...)
boolean | dataLineAvailable (void)
String | readDataLine (void)
String | concatenateWith (String s1, String s2)
char | letterOf (int i, String s)
int | stringLength (String s)
boolean | equalString (String s1, String s2)
float | getValue (String key)
Public Member Functions inherited from MePort
| MePort (void)
| MePort (uint8_t port)
| MePort (uint8_t port, uint8_t slot)
uint8_t | getPort (void)
uint8_t | getSlot (void)
bool | dRead1 (uint8_t mode=INPUT)
bool | dRead2 (uint8_t mode=INPUT)
bool | dpRead1 (void)
bool | dpRead2 (void)
void | dWrite1 (bool value)
void | dWrite2 (bool value)
int16_t | aRead1 (void)
int16_t | aRead2 (void)
void | aWrite1 (int16_t value)
void | aWrite2 (int16_t value)
void | reset (uint8_t port)
void | reset (uint8_t port, uint8_t slot)
uint8_t | pin1 (void)
uint8_t | pin2 (void)
uint8_t | pin (void)
uint8_t | pin (uint8_t port, uint8_t slot)
Public Member Functions inherited from SoftwareSerial
| SoftwareSerial (uint8_t receivePin, uint8_t transmitPin, bool inverse_logic=false)
void | begin (long speed)
bool | listen ()
void | end ()
bool | isListening ()
bool | stopListening ()
bool | overflow ()
int | peek ()
virtual void | flush ()
| operator bool ()

## Additional Inherited Members
Static Public Member Functions inherited from SoftwareSerial
static void | handle_interrupt () __attribute__((__always_inline__))
Protected Attributes inherited from MeSerial
bool | _hard
bool | _polling
bool | _scratch
int16_t | _bitPeriod
int16_t | _byte
long | _lastTime
char | buffer [64]
String | lastLine
int | bufferIndex
Protected Attributes inherited from MePort
uint8_t | s1
uint8_t | s2
uint8_t | _port
uint8_t | _slot

## Detailed Description

Driver for Me Infrared Receiver device.

Class: MeInfraredReceiver

Description
  Declaration of Class MeInfraredReceiver

Copyright (C), 2012-2016, MakeBlock

## Constructor & Destructor Documentation

## ◆ MeInfraredReceiver() [1/2]

MeInfraredReceiver::MeInfraredReceiver | ( | void |  | ) |

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

Parameters

  [in] | None |

## ◆ MeInfraredReceiver() [2/2]

MeInfraredReceiver::MeInfraredReceiver | ( | uint8_t | port | ) |

Alternate Constructor which can call your own function to map the Infrared Receiver to arduino port, If the hardware serial was selected, we will used the hardware serial.

Parameters

  [in] | port | - RJ25 port from PORT_1 to M2

## Member Function Documentation

## ◆ begin()

void MeInfraredReceiver::begin | ( | void |  | ) |

Function
  begin

Description
  Sets the speed (baud rate) for the serial communication. Supported baud rates is 9600bps

Output
  None

Returns
  None

Others
  None

## ◆ buttonState()

bool MeInfraredReceiver::buttonState | ( | void |  | ) |

Function
  buttonState

Description
  Check button press state

Output
  None

Returns
  true: The button is pressed, false: No button is pressed

Others
  None

## ◆ getCode()

uint8_t MeInfraredReceiver::getCode | ( | void |  | ) |

Function
  getCode

Description
  Get the button code

Output
  None

Returns
  Return the button code

Others
  None

## ◆ loop()

void MeInfraredReceiver::loop | ( | void |  | ) |

Function
  loop

Description
  This function used with getCode, it should called in the main loop

Output
  None

Returns
  None

Others
  This function used with getCode

## ◆ read()

int MeInfraredReceiver::read | ( | void |  | ) |
| virtual

Function
  read

Description
  Return a character that was received on the RX pin of the software serial port. Note that only one SoftwareSerial instance can receive incoming data at a time (select which one with the listen() function).

Output
  None

Returns
  The character read, or -1 if none is available

Others
  None

Reimplemented from SoftwareSerial.

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

- src/MeInfraredReceiver.h
- src/MeInfraredReceiver.cpp