Show:
Extends webduino.Module

The HX711 Class.

HX711 is a precision 24-bit analogto-digital converter (ADC) designed for weigh scales.

Constructor

webduino.module.HX711
(
  • board
  • sckPin
  • dtPin
)

Parameters:

  • board webduino.Board

    The board that the IRLed is attached to.

  • sckPin Integer

    The pin that Serial Clock Input is attached to.

  • dtPin Integer

    The pin that Data Output 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/HX711.js:89

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 measuring.

type

String readonly

Type of the module.

Events

HX711.MESSAGE

Fires when the value of weight has changed.