|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wpi.first.wpilibj.SensorBase
edu.wpi.first.wpilibj.HiTechnicColorSensor
public class HiTechnicColorSensor
HiTechnic NXT Color Sensor. This class allows access to a HiTechnic NXT Color Sensor on an I2C bus. These sensors do not allow changing addresses so you cannot have more than one on a single bus. Details on the sensor can be found here: http://www.hitechnic.com/index.html?lang=en-us&target=d17.html
Nested Class Summary | |
---|---|
class |
HiTechnicColorSensor.ColorSensorException
An exception dealing with connecting to and communicating with the HiTechnicCompass |
class |
HiTechnicColorSensor.RGB
A set of three color values bundled into one object |
static class |
HiTechnicColorSensor.tColorSensorMode
|
Field Summary |
---|
Fields inherited from class edu.wpi.first.wpilibj.SensorBase |
---|
kAnalogChannels, kAnalogModules, kDigitalChannels, kPwmChannels, kRelayChannels, kSolenoidChannels, kSolenoidModules, kSystemClockTicksPerMicrosecond |
Constructor Summary | |
---|---|
HiTechnicColorSensor(int slot)
Constructor. |
Method Summary | |
---|---|
void |
free()
Destructor. |
int |
getBlue()
Get the Blue value. |
byte |
getColor()
Get the estimated color. |
int |
getGreen()
Get the Green value. |
double |
getRawBlue()
Get the Raw Blue value. |
double |
getRawGreen()
Get the Raw Green value. |
double |
getRawRed()
Get the Raw Red value. |
HiTechnicColorSensor.RGB |
getRawRGB()
Get the raw value of all three colors from a single sensor reading. |
int |
getRed()
Get the Red value. |
HiTechnicColorSensor.RGB |
getRGB()
Get the value of all three colors from a single sensor reading. |
java.lang.String |
getSmartDashboardType()
|
ITable |
getTable()
|
void |
initTable(ITable subtable)
Initializes a table for this sendable object. |
void |
setMode(HiTechnicColorSensor.tColorSensorMode mode)
Set the Mode of the color sensor This method is used to set the color sensor to one of the three modes, active, passive or raw. |
void |
startLiveWindowMode()
Start having this sendable object automatically respond to value changes reflect the value on the table. |
void |
stopLiveWindowMode()
Stop having this sendable object automatically respond to value changes. |
void |
updateTable()
Update the table for this sendable object with the latest values. |
Methods inherited from class edu.wpi.first.wpilibj.SensorBase |
---|
checkAnalogChannel, checkAnalogModule, checkDigitalChannel, checkDigitalModule, checkPWMChannel, checkPWMModule, checkRelayChannel, checkRelayModule, checkSolenoidChannel, checkSolenoidModule, getDefaultAnalogModule, getDefaultDigitalModule, getDefaultSolenoidModule, setDefaultAnalogModule, setDefaultDigitalModule, setDefaultSolenoidModule |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HiTechnicColorSensor(int slot)
slot
- The slot of the digital module that the sensor is plugged into.Method Detail |
---|
public void free()
free
in class SensorBase
public byte getColor()
public HiTechnicColorSensor.RGB getRGB()
public int getRed()
public int getGreen()
public int getBlue()
public double getRawRed()
public double getRawGreen()
public double getRawBlue()
public HiTechnicColorSensor.RGB getRawRGB()
public void setMode(HiTechnicColorSensor.tColorSensorMode mode)
mode
- The mode to setpublic java.lang.String getSmartDashboardType()
getSmartDashboardType
in interface Sendable
public void initTable(ITable subtable)
initTable
in interface Sendable
subtable
- The table to put the values in.public ITable getTable()
getTable
in interface Sendable
public void updateTable()
updateTable
in interface LiveWindowSendable
public void startLiveWindowMode()
startLiveWindowMode
in interface LiveWindowSendable
public void stopLiveWindowMode()
stopLiveWindowMode
in interface LiveWindowSendable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |