com.rngtng.rainbowduino
Class Rainbowduino

java.lang.Object
  extended by com.rngtng.rainbowduino.Rainbowduino
All Implemented Interfaces:
RCodes

public class Rainbowduino
extends java.lang.Object
implements RCodes

Author:
rngtng - Tobias Bielohlawek

Field Summary
static int height
           
 java.lang.String VERSION
           
static int width
           
 
Fields inherited from interface com.rngtng.rainbowduino.RCodes
API_VERSION, API_VERSION_NR, BRIGHTNESS_GET, BRIGHTNESS_SET, BUFFER_GET_AT, BUFFER_LENGTH, BUFFER_LOAD, BUFFER_SAVE, BUFFER_SET_AT, COMMAND, ERROR, ERROR_MISSMATCH, ERROR_TIME_OUT, FRAME_GET, FRAME_SET, OK, PING, RESET, SPEED_DEC, SPEED_GET, SPEED_INC, SPEED_SET, START, STOP
 
Constructor Summary
Rainbowduino(processing.core.PApplet _app)
          Create a new instance to communicate with the rainbowduino.
 
Method Summary
 int apiVersion()
           
 int brightnessGet()
           
 void brightnessSet(int brightness)
          Sets the brightness value
 int[] bufferGetAt(int adr)
           
 int bufferLength()
           
 int bufferLoad()
          loads current buffer from EEPROM
 void bufferSave()
          saves current buffer to EEPROM
 void bufferSetAt(int adr, int[] content)
          fills buffer with given data at given position
 void bufferSetAt(int adr, int[] content, boolean check)
          fills buffer with given data at given position
 boolean connected()
           
 void dispose()
           
 int frameGet()
           
 void frameSet(int frame_pos)
          set frame pointer to given position
 void initPort()
          auto init serial port by default values
 void initPort(int _baud)
          Auto init serial port with given baud rate
 void initPort(java.lang.String port_name, int _baud, boolean check)
          Open serial port with given name and baud rate.
 boolean ping()
           
 void reset()
          resets rainbowduino
 void speedDown()
          decreases speed value
 int speedGet()
           
 void speedSet(int speed_value)
          sets speed to given value
 void speedUp()
          increases speed value
 void start()
          start running standalone, looping throgh set frames
 void stop()
          stops running
 java.lang.String version()
          return the version of the library.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

width

public static int width

height

public static int height

VERSION

public final java.lang.String VERSION
See Also:
Constant Field Values
Constructor Detail

Rainbowduino

public Rainbowduino(processing.core.PApplet _app)
Create a new instance to communicate with the rainbowduino. Make sure to (auto)init the serial port, too

Parameters:
_app - parent Applet
Method Detail

dispose

public void dispose()

version

public java.lang.String version()
return the version of the library.

Returns:
String version number

connected

public boolean connected()
Returns:
wheter rainbowudino is connected

initPort

public void initPort()
auto init serial port by default values


initPort

public void initPort(int _baud)
Auto init serial port with given baud rate

Parameters:
_baud -

initPort

public void initPort(java.lang.String port_name,
                     int _baud,
                     boolean check)
Open serial port with given name and baud rate. No sensity checks


apiVersion

public int apiVersion()
Returns:
int version number of the api

ping

public boolean ping()
Returns:
wheter ping was successfull TODO: add time??

reset

public void reset()
resets rainbowduino


start

public void start()
start running standalone, looping throgh set frames


stop

public void stop()
stops running


frameSet

public void frameSet(int frame_pos)
set frame pointer to given position

Parameters:
frame_pos - number of frame to set to

frameGet

public int frameGet()
Returns:
current position of frame pointer

brightnessSet

public void brightnessSet(int brightness)
Sets the brightness value


brightnessGet

public int brightnessGet()
Returns:
the current brightness value

bufferSetAt

public void bufferSetAt(int adr,
                        int[] content)
fills buffer with given data at given position


bufferSetAt

public void bufferSetAt(int adr,
                        int[] content,
                        boolean check)
fills buffer with given data at given position

Parameters:
adr - position
content - buffer data
check - wheter to perform sensity check

bufferGetAt

public int[] bufferGetAt(int adr)
Parameters:
adr -
Returns:
buffer data at given position

bufferLength

public int bufferLength()
Returns:
buffer length

bufferSave

public void bufferSave()
saves current buffer to EEPROM


bufferLoad

public int bufferLoad()
loads current buffer from EEPROM


speedSet

public void speedSet(int speed_value)
sets speed to given value


speedGet

public int speedGet()
Returns:
current speed

speedUp

public void speedUp()
increases speed value


speedDown

public void speedDown()
decreases speed value



processing library rainbowduino by rngtng - Tobias Bielohlawek. (c) 2009