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:
-
board
webduino.BoardThe board that the Max7219 is attached to.
-
din
IntegerPin number of DIn (Data In).
-
cs
IntegerPin number of LOAD/CS.
-
clk
IntegerPin number of CLK.
Methods
addListener
-
type
-
listener
Add a listener for a certain type of event.
Parameters:
-
type
StringEvent type.
-
listener
FunctionEvent listener.
animate
-
data
-
times
-
duration
-
callback
Display animated pattern.
Parameters:
-
data
ArrayArray of patterns.
-
times
IntegerDelay time (in microsecond) between patterns.
-
duration
IntegerDuration of animation.
-
callback
FunctionCallback 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
StringEvent type.
-
[object,...]
Object optionalEvent object(s).
listeners
-
type
Return the listener list bound to certain type of event.
Parameters:
-
type
StringEvnet type.
off
()
Clear pattern on LED matrix.
on
-
data
Show pattern LED matrix.
Parameters:
-
data
StringPattern to display.
Example:
matrix.on("0000000000000000");
once
-
type
-
listener
Add a one-time listener for a certain type of event.
Parameters:
-
type
StringEvent type.
-
listener
FunctionEvent listener.
removeAllListeners
-
type
Remove all listeners of certain type.
Parameters:
-
type
StringEvent type.
removeListener
-
type
-
listener
Remove a listener for certain type of event.
Parameters:
-
type
StringEvent type.
-
listener
FunctionEvent listener.
setMaxListeners
-
n
Set maximum number of listeners that is allow to bind on an emitter.
Parameters:
-
n
NumberNumber of listeners.