public class DULRadio extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
DULRadio.SerialProxy
We need a class descended from PApplet so that we can override the
serialEvent() method to capture serial data.
|
| Constructor and Description |
|---|
DULRadio(PApplet parent,
String comport)
Simple initialize
|
DULRadio(PApplet parent,
String comport,
int baud,
int del)
Initialize interaction with DUL Radio
|
| Modifier and Type | Method and Description |
|---|---|
void |
configShakeEvent(int id,
int minForce,
int minDirChange,
int maxPausBtwnDirChg,
int maxTotDurShk)
Configure when a shake is registered
|
void |
dispose()
Closes the serial connection when the parent PApplet closes
|
Integer[] |
getCurrentData(int id) |
String |
getState(int id) |
int[] |
getTiltPosition(int id) |
void |
setSmoothSamples(int id,
int s) |
int[] |
smoothValues(int id) |
public DULRadio(PApplet parent, String comport, int baud, int del)
parent - The Processing sketch (PApplet)comport - The COM port the USB stick is connected tobaud - The Baud rate (defaults to 9600)del - A delimiter for when to stop buffering and send to main sketch (defaults to 13)public void dispose()
public Integer[] getCurrentData(int id)
id - the id of the sensor board to get data frompublic String getState(int id)
id - the id of the sensor board to get data frompublic void configShakeEvent(int id,
int minForce,
int minDirChange,
int maxPausBtwnDirChg,
int maxTotDurShk)
id - the id of the sensor board to get data fromminForce - The minimum force to considerminDirChange - Minimum times in a shake gesture that the direction of movement needs to change.maxPausBtwnDirChg - Maximum pause between movements.maxTotDurShk - Maximum allowed time for shake gesture.public void setSmoothSamples(int id,
int s)
id - the id of the sensor board to get data froms - number of samples to smooth overpublic int[] smoothValues(int id)
id - the id of the sensor board to get data frompublic int[] getTiltPosition(int id)
id - the id of the sensor board to get data fromProcessing library DULRadio by Lasse Steenbock Vestergaard. (C) 2011