public class ControllerThread
extends java.lang.Thread
Modifier and Type | Method and Description |
---|---|
void |
closeSerialPort()
Closes the serial connection and releases the serial port.
|
LEDStrip |
getStrip(byte pin)
Gets the LEDStrip instance of the given pin.
|
int |
getTPS()
Gets the ticks per second rate of the controller thread.
|
boolean |
initSerialPort()
Initializes the serial port.
|
void |
loadStrip(byte pin)
Requests the microcontroller for the data of the strip on the given pin.
|
static boolean |
providesAmbilight()
Checks if the ambilight provider is enabled.
|
void |
refreshConnection()
Disconnects from the current serial port if connected and tries to make a
new connection to a serial port.
|
void |
run() |
void |
saveStrip(byte pin)
Saves the data of the strip on the microcontroller for the given pin.
|
void |
setProvideAmbilight(boolean provideAmbilight)
Sets the enabled flag of the ambilight provider.
|
void |
updateBrightness(byte pin,
byte value)
Sends a new brightness value to the microcontroller for the given pin.
|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public void closeSerialPort()
public boolean initSerialPort()
refreshConnection()
instead.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public LEDStrip getStrip(byte pin)
pin
- The pin of the strip on the microcontroller.public void loadStrip(byte pin)
pin
- The pin on the microcontroller.public void saveStrip(byte pin)
pin
- The pin on the microcontroller.public void updateBrightness(byte pin, byte value)
pin
- The pin on the microcontroller.value
- The new brightness value as a signed byte in the range of
0-255.public void refreshConnection()
public static boolean providesAmbilight()
public void setProvideAmbilight(boolean provideAmbilight)
provideAmbilight
- The new enable status.public int getTPS()