Skip to content

Commit c84fe97

Browse files
authored
Joystick position correction
1 parent 07d31da commit c84fe97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ void loop() {
5151
int yValue = analogRead(A1);
5252

5353
// map the values and update the position
54-
xPos = xPos + (map(xValue, 0, 1023, 2, -2));
55-
yPos = yPos + (map(yValue, 0, 1023, -2, 2));
54+
xPos = xPos + (map(xValue, 0, 1023, 2, -3));
55+
yPos = yPos + (map(yValue, 0, 1023, -2, 3));
5656

5757
// don't let the point go past the screen edges
5858
if (xPos > 159) {

0 commit comments

Comments
 (0)