public final class LightDriveSerial
extends java.lang.Object
Constructor and Description |
---|
LightDriveSerial()
Creates an instance of LightDriveSerial to control
the LightDrive12 via MXP Serial Port.
|
LightDriveSerial(edu.wpi.first.wpilibj.SerialPort.Port port)
Creates an instance of LightDriveSerial to control
the LightDrive12 via the specified port.
|
Modifier and Type | Method and Description |
---|---|
float |
GetCurrent(int ch)
Return the approximate current from the specified channel bank
|
int |
GetFWVersion()
Returns the attached LightDrive's firmware version
|
Status |
GetStatus()
Returns a Status class for the LightDrive
|
float |
GetTotalCurrent()
Returns the total approximate LightDrive current.
|
float |
GetVoltage()
Returns the LightDrive input voltage
|
void |
SetColor(int ch,
java.awt.Color color)
Set the given channel's Color
|
void |
SetColor(int ch,
java.awt.Color color,
double brightness)
Set the given channel's Color with a brightness scalar
|
void |
SetLevel(int ch,
byte level)
Sets the raw pwm output value for a desired channel
|
void |
Update()
Send new data to LightDrive.
|
public LightDriveSerial()
public LightDriveSerial(edu.wpi.first.wpilibj.SerialPort.Port port)
public void Update()
public void SetColor(int ch, java.awt.Color color)
ch
- Int (1-4) representing the desired bank of channels to setcolor
- Color class representing the desired Colorpublic void SetColor(int ch, java.awt.Color color, double brightness)
ch
- Int (1-4) representing the desired bank of channels to setcolor
- Color class representing the desired Colorbrightness
- Double representing the desired brightness scaled 0.0 to 1.0public void SetLevel(int ch, byte level)
ch
- Int (1-12) representing the desired channellevel
- Byte (0-255) representing the desired duty cycle scaled 0 to 255public float GetCurrent(int ch)
ch
- Int (1-4) indicating the desired bank to read frompublic float GetTotalCurrent()
public float GetVoltage()
public int GetFWVersion()
public Status GetStatus()