From c84fe973ae63a7ce4e835dbf79d55d0e4e7c9425 Mon Sep 17 00:00:00 2001 From: Diviector <57515291+Diviector@users.noreply.github.com> Date: Sat, 15 Jan 2022 13:07:04 +0700 Subject: [PATCH] Joystick position correction --- examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino b/examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino index 41c0200..88125f8 100644 --- a/examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino +++ b/examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino @@ -51,8 +51,8 @@ void loop() { int yValue = analogRead(A1); // map the values and update the position - xPos = xPos + (map(xValue, 0, 1023, 2, -2)); - yPos = yPos + (map(yValue, 0, 1023, -2, 2)); + xPos = xPos + (map(xValue, 0, 1023, 2, -3)); + yPos = yPos + (map(yValue, 0, 1023, -2, 3)); // don't let the point go past the screen edges if (xPos > 159) {