From 62f58d44b6b0e281109a49fb95e486a4f272831f Mon Sep 17 00:00:00 2001 From: Diviector <57515291+Diviector@users.noreply.github.com> Date: Fri, 7 Jan 2022 00:22:51 +0700 Subject: [PATCH 1/3] Update TFTEtchASketch.ino Updated the mapping of signal values from the joystick to the offset coordinates. Fixed screen cleaning. --- examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino b/examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino index 41c0200..5d0d6cf 100644 --- a/examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino +++ b/examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino @@ -39,6 +39,7 @@ int erasePin = 2; void setup() { // declare inputs pinMode(erasePin, INPUT); + digitalWrite(erasePin, HIGH); // initialize the screen TFTscreen.begin(); // make the background black @@ -51,8 +52,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) { @@ -75,7 +76,7 @@ void loop() { TFTscreen.point(xPos, yPos); // read the value of the pin, and erase the screen if pressed - if (digitalRead(erasePin) == HIGH) { + if (digitalRead(erasePin) == LOW) { TFTscreen.background(0, 0, 0); } From e1ca3399e9a8e7a27fd20dd2e54fcf97a0bff6da Mon Sep 17 00:00:00 2001 From: Diviector <57515291+Diviector@users.noreply.github.com> Date: Thu, 13 Jan 2022 15:38:02 +0700 Subject: [PATCH 2/3] Update examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino Co-authored-by: per1234 --- examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino b/examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino index 5d0d6cf..3da8743 100644 --- a/examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino +++ b/examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino @@ -39,7 +39,6 @@ int erasePin = 2; void setup() { // declare inputs pinMode(erasePin, INPUT); - digitalWrite(erasePin, HIGH); // initialize the screen TFTscreen.begin(); // make the background black From 4386d34395d601015503f32b15f8ab21de1e6358 Mon Sep 17 00:00:00 2001 From: Diviector <57515291+Diviector@users.noreply.github.com> Date: Thu, 13 Jan 2022 15:38:12 +0700 Subject: [PATCH 3/3] Update examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino Co-authored-by: per1234 --- examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino b/examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino index 3da8743..e7093b9 100644 --- a/examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino +++ b/examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino @@ -75,7 +75,6 @@ void loop() { TFTscreen.point(xPos, yPos); // read the value of the pin, and erase the screen if pressed - if (digitalRead(erasePin) == LOW) { TFTscreen.background(0, 0, 0); }