|
FreeJ scripting | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object
|
+--Controller
|
+--WiiController
The WiiController connects via bluetooth to a Nintendo wii remote controller.
For more information on this device see http://abstrakraft.org/cwiid/
| Constructor Summary | |
WiiController(outdevice)
Nintendo Wii remote control. |
|
| Method Summary | |
void callback
|
acceleration(<double> x, <double> y, <double> z)
Callback on accelleration changes |
double
|
battery()
Battery status |
void callback
|
button(<int> button, <bool> state, <int> mask, <int> old_mask)
Callback on button changes |
void
|
close()
Disconnect the wii |
void callback
|
connect()
Callback on sucessful connect |
void callback
|
disconnect()
Callback on disconnect. |
void
|
dump()
Dumps out some information about WiiController state to the console. |
bool callback
|
error(<int> status)
Callback on errors. |
void callback
|
ir(<int> source, <int> x, <int> y, <int> size)
Callback on infrared changes |
void
|
open(<string> bdaddr)
Connect to wii. |
bool
|
toggle_accel(<bool> state)
toggle acceleration data on/off |
bool
|
toggle_buttons(<bool> state)
toggle button data on/off |
bool
|
toggle_ir(<bool> state)
toggle infrared data on/off |
bool
|
toggle_led(<int> led, <bool> state)
toggle led on/off |
bool
|
toggle_rumble(<bool> state)
toggle rumble on/off |
int
|
x()
Last x accel state |
int
|
y()
Last y accel state |
int
|
z()
Last z accel state |
| Methods inherited from class Controller |
activate, get_name
|
| Constructor Detail |
WiiController(outdevice)
The WiiController constructor creates a controller which holds the callbacks. There's an example script "wiimote.js".
| Method Detail |
void callback acceleration(<double> x, <double> y, <double> z)
x - current x-axis value
y - current y-axis value
z - current z-axis value
double battery()
void callback button(<int> button, <bool> state, <int> mask, <int> old_mask)
button - wii button number
state - True if button is pressed, False if button is released
mask - current button mask
old_mask - old button mask
void close()
void callback connect()
void callback disconnect()
void dump()
bool callback error(<int> status)
status - error code : void callback ir(<int> source, <int> x, <int> y, <int> size)
source - number of ir source
x - current x value
y - current y value
size - current ir size
void open(<string> bdaddr)
bdaddr - (optional) wii remote device address (e.g.: "00:19:1D:66:91:D3"). Leave empty to scan and connect to any wii.
bool toggle_accel(<bool> state)
state - (optional) switch acceleration datastream, if not specified current state is returned.
bool toggle_buttons(<bool> state)
state - (optional) switch button datastream, if not specified current state is returned.
bool toggle_ir(<bool> state)
state - (optional) switch infrared datastream, if not specified current state is returned.
bool toggle_led(<int> led, <bool> state)
led - number of the led (1-4).
state - (optional), if not specified current state is returned.
bool toggle_rumble(<bool> state)
state - (optional) switch rumble, if not specified current state is returned.
int x()
int y()
int z()
|
FreeJ scripting | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
FreeJ scripting documentation is Copyleft (C) 2000 - 2007 dyne.org foundation. Verbatim copying and distribution of this entire page is permitted in any medium, provided this notice is preserved.