|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.spot.resources.Resource
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 | |
|---|---|
SensorEvent |
createSensorEvent()
Create a SensorEvent of the appropriate type for this sensor. |
int |
getBlue()
Return the current blue setting. |
LEDColor |
getColor()
Get the current color of the LED. |
String |
getDescription()
This method returns a readable description of the sensor. |
int |
getGreen()
Return the current green setting. |
PinDescriptor |
getIndex()
Return the PinDescriptor associated with this LED. |
double |
getMaxSamplingRate()
Return the maximum sampling rate per second for this sensor. |
int |
getRed()
Return the current red setting. |
boolean |
isOn()
Return if the LED is on or off. |
void |
saveEventState(SensorEvent evt)
Save the current sensor state in the specified event. |
void |
setColor(LEDColor rgb)
Set the color of the LED |
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 com.sun.spot.resources.Resource |
|---|
addTag, getTags, getTagValue, hasTag, removeTag |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sun.spot.resources.IResource |
|---|
addTag, getTags, getTagValue, hasTag, removeTag |
| Methods inherited from interface com.sun.spot.resources.IResource |
|---|
addTag, getTags, getTagValue, hasTag, removeTag |
| Constructor Detail |
|---|
public TriColorLED(PinDescriptor pidx,
ITriColorLEDController cntrl)
pidx - the pin connected to this LEDcntrl - the SPI controller for this LED| Method Detail |
|---|
public PinDescriptor getIndex()
getIndex in interface IBasicPin
public void setRGB(int redRGB,
int greenRGB,
int blueRGB)
setRGB in interface ITriColorLEDredRGB - 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)
rgb - the new colorpublic void setColor(LEDColor rgb)
ITriColorLED
setColor in interface ITriColorLEDrgb - the new colorpublic void setOn()
setOn in interface ILedpublic void setOff()
setOff in interface ILedpublic void setOn(boolean on)
setOn in interface ILedon - turn LED on if truepublic boolean isOn()
isOn in interface ILedpublic int getRed()
getRed in interface ITriColorLEDpublic int getGreen()
getGreen in interface ITriColorLEDpublic int getBlue()
getBlue in interface ITriColorLEDpublic LEDColor getColor()
getColor in interface ITriColorLEDpublic String getDescription()
ITransducer
getDescription in interface ITransducerpublic double getMaxSamplingRate()
ITransducer
getMaxSamplingRate in interface ITransducerpublic SensorEvent createSensorEvent()
ITransducer
createSensorEvent in interface ITransducerpublic void saveEventState(SensorEvent evt)
ITransducer
saveEventState in interface ITransducerevt - the event to store the sensor state in
|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||