Show:
Extends webduino.Module

The Max7219 Class.

MAX7219 is compact, serial input/output common-cathode display drivers that interface microprocessors (µPs) to 7-segment numeric LED displays of up to 8 digits, bar-graph displays, or 64 individual LEDs.

Constructor

webduino.module.Max7219
(
  • board
  • din
  • cs
  • clk
)

Parameters:

  • board webduino.Board

    The board that the Max7219 is attached to.

  • din Integer

    Pin number of DIn (Data In).

  • cs Integer

    Pin number of LOAD/CS.

  • clk Integer

    Pin number of CLK.

Methods

addListener
(
  • type
  • listener
)

Add a listener for a certain type of event.

Parameters:

  • type String

    Event type.

  • listener Function

    Event listener.

animate
(
  • data
  • times
  • duration
  • callback
)

Display animated pattern.

Parameters:

  • data Array

    Array of patterns.

  • times Integer

    Delay time (in microsecond) between patterns.

  • duration Integer

    Duration of animation.

  • callback Function

    Callback after animation.

Example:

var data = ["080c0effff0e0c08", "387cfefe82443800", "40e0e0e07f030604"];
    matrix.on("0000000000000000");
    matrix.animate(data, 100);
animateStop ()

Stop displaying animated pattern.

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 ()

Clear pattern on LED matrix.

on
(
  • data
)

Inherited from webduino.EventEmitter but overwritten in src/module/Max7219.js:70

Show pattern LED matrix.

Parameters:

  • data String

    Pattern to display.

Example:

matrix.on("0000000000000000");
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

intensity

Integer Value of brightness (0~15).

The intensity indicating brightness of Max7219.

type

String readonly

Type of the module.