webduino.module.RGBLed
The RGBLed Class.
Table of Contents
Constructor
webduino.module.RGBLed
-
board -
redLedPin -
greenLedPin -
blueLedPin -
driveMode
Parameters:
-
boardwebduino.BoardThe board the RGB LED is attached to.
-
redLedPinwebduino.PinThe pin the red LED is connected to.
-
greenLedPinwebduino.PinThe pin the green LED is connected to.
-
blueLedPinwebduino.PinThe pin the blue LED is connected to.
-
[driveMode]Number optionalDrive mode the RGB LED is operating at, either RGBLed.COMMON_ANODE or RGBLed.COMMON_CATHODE.
Methods
addListener
-
type -
listener
Add a listener for a certain type of event.
Parameters:
-
typeStringEvent type.
-
listenerFunctionEvent listener.
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.
on
-
type -
listener
Alias for EventEmitter.addListener(type, listener)
Parameters:
-
typeStringEvent type.
-
listenerFunctionEvent listener.
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.
setColor
-
red -
green -
blue -
callback
Light up and mix colors with the LEDs.
Parameters:
-
redNumberThe brightness of the red LED.
-
greenNumberThe brightness of the green LED.
-
blueNumberThe brightness of the blue LED.
-
[callback]Function optionalFunction to call when the color is set.
setMaxListeners
-
n
Set maximum number of listeners that is allow to bind on an emitter.
Parameters:
-
nNumberNumber of listeners.
Properties
COMMON_ANODE
Number
const
static
Indicates the common anode drive mode.
COMMON_CATHODE
Number
const
static
Indicates the common cathode drive mode.