webduino.module.Max7219
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.
Table of Contents
Constructor
webduino.module.Max7219
-
board -
din -
cs -
clk
Parameters:
-
boardwebduino.BoardThe board that the Max7219 is attached to.
-
dinIntegerPin number of DIn (Data In).
-
csIntegerPin number of LOAD/CS.
-
clkIntegerPin number of CLK.
Methods
addListener
-
type -
listener
Add a listener for a certain type of event.
Parameters:
-
typeStringEvent type.
-
listenerFunctionEvent listener.
animate
-
data -
times -
duration -
callback
Display animated pattern.
Parameters:
-
dataArrayArray of patterns.
-
timesIntegerDelay time (in microsecond) between patterns.
-
durationIntegerDuration of animation.
-
callbackFunctionCallback 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:
-
typeStringEvent type.
-
[object,...]Object optionalEvent object(s).
listeners
-
type
Return the listener list bound to certain type of event.
Parameters:
-
typeStringEvnet type.
off
()
Clear pattern on LED matrix.
on
-
data
Show pattern LED matrix.
Parameters:
-
dataStringPattern to display.
Example:
matrix.on("0000000000000000");
once
-
type -
listener
Add a one-time listener for a certain type of event.
Parameters:
-
typeStringEvent type.
-
listenerFunctionEvent listener.
removeAllListeners
-
type
Remove all listeners of certain type.
Parameters:
-
typeStringEvent type.
removeListener
-
type -
listener
Remove a listener for certain type of event.
Parameters:
-
typeStringEvent type.
-
listenerFunctionEvent listener.
setMaxListeners
-
n
Set maximum number of listeners that is allow to bind on an emitter.
Parameters:
-
nNumberNumber of listeners.