webduino.module.RGBLed
The RGBLed Class.
Table of Contents
Constructor
webduino.module.RGBLed
-
board
-
redLedPin
-
greenLedPin
-
blueLedPin
-
driveMode
Parameters:
-
board
webduino.BoardThe board the RGB LED is attached to.
-
redLedPin
webduino.PinThe pin the red LED is connected to.
-
greenLedPin
webduino.PinThe pin the green LED is connected to.
-
blueLedPin
webduino.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:
-
type
StringEvent type.
-
listener
FunctionEvent listener.
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.
on
-
type
-
listener
Alias for EventEmitter.addListener(type, listener)
Parameters:
-
type
StringEvent type.
-
listener
FunctionEvent listener.
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.
setColor
-
red
-
green
-
blue
-
callback
Light up and mix colors with the LEDs.
Parameters:
-
red
NumberThe brightness of the red LED.
-
green
NumberThe brightness of the green LED.
-
blue
NumberThe 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:
-
n
NumberNumber 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.