|
SunSPOT API V5.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.spot.sensorboard.peripheral.TriColorLED
public class TriColorLED
Provides access to the colored LEDs. LED state is now kept by the ITriColorLEDController.
Constructor Summary | |
---|---|
TriColorLED(PinDescriptor pidx,
ITriColorLEDController cntrl)
Constructor. |
Method Summary | |
---|---|
int |
getBlue()
Return the current blue setting. |
LEDColor |
getColor()
Get the current color of the LED. |
int |
getGreen()
Return the current green setting. |
PinDescriptor |
getIndex()
Return the PinDescriptor associated with this LED. |
int |
getRed()
Return the current red setting. |
boolean |
isOn()
Return if the LED is on or off. |
void |
setColor(LEDColor rgb)
Set the color of the LED |
void |
setOff()
Turn the LED off. |
void |
setOn()
Turn the LED on, using the currently stored intensity values (initially zero). |
void |
setOn(boolean on)
Turn the LED on or off |
void |
setRGB(int redRGB,
int greenRGB,
int blueRGB)
Set the colour of the LED. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TriColorLED(PinDescriptor pidx, ITriColorLEDController cntrl)
pidx
- the pin connected to this LEDcntrl
- the SPI controller for this LEDMethod Detail |
---|
public PinDescriptor getIndex()
getIndex
in interface ITriColorLED
public void setRGB(int redRGB, int greenRGB, int blueRGB)
setRGB
in interface ITriColorLED
redRGB
- the intensity of the red portion, in the range 0-255greenRGB
- the intensity of the green portion, in the range 0-255blueRGB
- the intensity of the blue portion, in the range 0-255public void setColor(LEDColor rgb)
setColor
in interface ITriColorLED
rgb
- the new colorpublic void setOn()
setOn
in interface ILed
public void setOff()
setOff
in interface ILed
public void setOn(boolean on)
setOn
in interface ILed
on
- turn LED on if truepublic boolean isOn()
isOn
in interface ILed
public int getRed()
getRed
in interface ITriColorLED
public int getGreen()
getGreen
in interface ITriColorLED
public int getBlue()
getBlue
in interface ITriColorLED
public LEDColor getColor()
getColor
in interface ITriColorLED
|
SunSPOT API V5.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |