Show:
Extends webduino.Module

The IRRecv Class.

Constructor

webduino.module.IRRecv
(
  • board
  • pin
)

Parameters:

  • board webduino.Board

    The board that the IRLed is attached to.

  • pin Integer

    The pin that the IRLed is connected to.

Methods

addListener
(
  • type
  • listener
)

Add a listener for a certain type of event.

Parameters:

  • type String

    Event type.

  • listener Function

    Event listener.

emit
(
  • type
  • object,...
)

Emit an event of certain type.

Parameters:

  • type String

    Event type.

  • [object,...] Object optional

    Event object(s).

listeners
(
  • type
)

Return the listener list bound to certain type of event.

Parameters:

  • type String

    Evnet type.

off ()

Stop detection.

on
(
  • callback
  • errorCallback
)
deprecated

Inherited from webduino.EventEmitter but overwritten in src/module/IRRecv.js:105

Deprecated: `on()` is deprecated, use `receive()` instead.

Start detection.

Parameters:

  • [callback] Function optional

    Detection callback.

  • [errorCallback] Function optional

    Error callback while Detection.

once
(
  • type
  • listener
)

Add a one-time listener for a certain type of event.

Parameters:

  • type String

    Event type.

  • listener Function

    Event listener.

receive
(
  • callback
  • errorCallback
)

Start detection.

Parameters:

  • [callback] Function optional

    Detection callback.

  • [errorCallback] Function optional

    Error callback while Detection.

removeAllListeners
(
  • type
)

Remove all listeners of certain type.

Parameters:

  • type String

    Event type.

removeListener
(
  • type
  • listener
)

Remove a listener for certain type of event.

Parameters:

  • type String

    Event type.

  • listener Function

    Event listener.

setMaxListeners
(
  • n
)

Set maximum number of listeners that is allow to bind on an emitter.

Parameters:

  • n Number

    Number of listeners.

Attributes

state

String on or off

The state indicating whether the IRLed is receiving.

type

String readonly

Type of the module.

Events

IRRecvEvent.MESSAGE

Fires when receiving data.

IRRecvEvent.MESSAGE_ERROR

Fires when error occured while receiving data.