aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena of Valhalla'' Grandi <valhalla.trueelena.org>2013-04-07 11:19:08 +0200
committerElena of Valhalla'' Grandi <valhalla.trueelena.org>2013-04-07 11:19:08 +0200
commit2a141ff744afade50014d33b88d3886c3f762857 (patch)
treeaa89642cffe864f2058cda8f2693fa6a7d98eaf3
parenta0ae9cffce8f3e6ab498c4754443ec484fb62640 (diff)
Arduino sketch: adjusted joystick range
-rw-r--r--arduino_sketch/arcerino/arcerino.ino4
1 files changed, 2 insertions, 2 deletions
diff --git a/arduino_sketch/arcerino/arcerino.ino b/arduino_sketch/arcerino/arcerino.ino
index b647fab..171bdb9 100644
--- a/arduino_sketch/arcerino/arcerino.ino
+++ b/arduino_sketch/arcerino/arcerino.ino
@@ -92,8 +92,8 @@ void update_position() {
drift_x = constrain(drift_x,-LCD_MAX,LCD_MAX);
drift_y = drift_y + random(-1,2);
drift_y = constrain(drift_y,-LCD_MAX,LCD_MAX);
- x = map(nunchuk_cjoy_x(),-JOY_MAX,JOY_MAX,-LCD_MAX,LCD_MAX) + drift_x;
- y = map(nunchuk_cjoy_y(),-JOY_MAX,JOY_MAX,LCD_MAX,-LCD_MAX) + drift_y;
+ x = map(nunchuk_cjoy_x(),-JOY_MAX,JOY_MAX,-LCD_MAX*2,LCD_MAX*2) + drift_x;
+ y = map(nunchuk_cjoy_y(),-JOY_MAX,JOY_MAX,LCD_MAX*2,-LCD_MAX*2) + drift_y;
}
char get_score() {