Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add speed and brightness controls to the wii

  • Loading branch information...
commit e69eaeb52ce4ab645c40eb8bef57ee3d1c79deef 1 parent 2681206
@cibomahto cibomahto authored
Showing with 18 additions and 1 deletion.
  1. +18 −1 WiiController.pde
View
19 WiiController.pde
@@ -54,7 +54,7 @@ class WiiController {
WiiController() {
// by default darwiinremoteOSC sends OSC messages to port 5600
- osc = new OscP5(this,5601);
+ osc = new OscP5(this,5600);
// the address and the port of darwiinremoteOSC
remoteAddress = "127.0.0.1";
@@ -250,18 +250,35 @@ class WiiController {
void buttonUp(int theValue) {
buttonUp = (theValue==1) ? true:false;
+
+ if(buttonUp) {
+ bright = min(1,bright + .1);
+ }
}
void buttonDown(int theValue) {
buttonDown = (theValue==1) ? true:false;
+
+ if(buttonDown) {
+ bright = max(.1,bright - .1);
+ }
}
void buttonLeft(int theValue) {
buttonLeft = (theValue==1) ? true:false;
+
+ if (buttonLeft) {
+ frameRate(max(15,frameRate - 5));
+ }
}
void buttonRight(int theValue) {
buttonRight = (theValue==1) ? true:false;
+
+ // make faster
+ if (buttonRight) {
+ frameRate(min(150,frameRate + 5));
+ }
}
void buttonHome(int theValue) {
Please sign in to comment.
Something went wrong with that request. Please try again.