|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectthingm.blink1.Blink1
public class Blink1
Constructor Summary | |
---|---|
Blink1()
Constructor. |
Method Summary | |
---|---|
void |
close()
Close blink(1) device |
int |
command(int cmd,
byte[] buf_send,
byte[] buf_recv)
FIXME: this does not work Do a transaction with the Blink1 length of both byte arrays determines amount of data sent or received |
int |
enumerate()
(re)Enumerate the bus and return a count of blink(1) device found |
int |
fadeToRGB(int fadeMillis,
int r,
int g,
int b)
Fade blink(1) to RGB color over fadeMillis milliseconds. |
int |
getCount()
|
java.lang.String[] |
getDevicePaths()
Return the list of blink(1) device paths found by enumerate |
java.lang.String[] |
getDeviceSerials()
Return the list of blink(1) device serials found by enumerate |
int |
getFirmwareVersion()
|
static int |
log2lin(int n)
one attempt at a degamma curve //FIXME: this is now in blink1-lib |
static void |
main(java.lang.String[] args)
Simple command-line demonstration |
int |
open()
Open blink(1) device. |
int |
openById(int id)
Open blink(1) device by blink(1) numerical id (0-getCount()) Id list is ordered by serial number. |
int |
openByPath(java.lang.String devicepath)
Open blink(1) device by USB path, may be different for each insertion |
int |
openBySerial(java.lang.String serialnumber)
Open blink(1) device by blink(1) serial number |
static void |
pause(int millis)
Utility: A simple delay |
int |
play(boolean play,
int pos)
|
static void |
print(java.lang.String s)
|
static void |
println(java.lang.String s)
|
int |
serverdown(boolean on,
int millis)
|
int |
setRGB(int r,
int g,
int b)
Set blink(1) RGB color immediately |
static void |
usage()
|
int |
writePatternLine(int fadeMillis,
int r,
int g,
int b,
int pos)
Write a blink(1) light pattern entry |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Blink1()
Method Detail |
---|
public static void usage()
public static void main(java.lang.String[] args)
public int enumerate()
public int getCount()
public java.lang.String[] getDevicePaths()
public java.lang.String[] getDeviceSerials()
public int open()
public void close()
public int openByPath(java.lang.String devicepath)
public int openBySerial(java.lang.String serialnumber)
public int openById(int id)
public int command(int cmd, byte[] buf_send, byte[] buf_recv)
cmd
- the blink1 command codebuf_send
- is byte array of command to send, may be nullbuf_recv
- is byte array of any receive data, may be nullpublic int setRGB(int r, int g, int b)
r
- red component 0-255g
- green component 0-255b
- blue component 0-255public int fadeToRGB(int fadeMillis, int r, int g, int b)
fadeMillis
- milliseconds to take to get to colorr
- red component 0-255g
- green component 0-255b
- blue component 0-255public int writePatternLine(int fadeMillis, int r, int g, int b, int pos)
fadeMillis
- milliseconds to take to get to colorr
- red component 0-255g
- green component 0-255b
- blue component 0-255pos
- entry position 0-patt_maxpublic int play(boolean play, int pos)
play
- true to play, false to stoppos
- starting position to play from, 0 = startpublic int serverdown(boolean on, int millis)
on
- true = turn on serverdown mode, false = turn it offmillis
- milliseconds until light pattern plays if not updatedpublic int getFirmwareVersion()
public static final int log2lin(int n)
public static final void pause(int millis)
public static final void println(java.lang.String s)
public static final void print(java.lang.String s)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |