From 2a141ff744afade50014d33b88d3886c3f762857 Mon Sep 17 00:00:00 2001 From: Elena of Valhalla'' Grandi Date: Sun, 7 Apr 2013 11:19:08 +0200 Subject: Arduino sketch: adjusted joystick range --- arduino_sketch/arcerino/arcerino.ino | 4 ++-- 1 file 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() { -- cgit v1.2.3