Show:
Extends webduino.Module

The Soil class.

Constructor

webduino.module.Soil
(
  • board
  • analogPinNumber
)

Parameters:

  • board webduino.Board

    Board that the soil is attached to.

  • analogPinNumber Integer

    The pin that soil is attached 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.

measure
(
  • callback
)

Start detection.

Parameters:

  • [callback] Function optional

    Callback after starting detection.

off ()

Stop detection.

on
(
  • callback
)
deprecated

Inherited from webduino.EventEmitter but overwritten in src/module/Soil.js:83

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

Start detection.

Parameters:

  • [callback] Function optional

    Callback after starting detection.

once
(
  • type
  • listener
)

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

Parameters:

  • type String

    Event type.

  • listener Function

    Event listener.

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 module is scanning.

type

String readonly

Type of the module.

Events

PhotocellEvent.MESSAGE

Fires when the value of humidity has changed.