We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45471a6 commit 62f58d4Copy full SHA for 62f58d4
examples/Arduino/TFTEtchASketch/TFTEtchASketch.ino
@@ -39,6 +39,7 @@ int erasePin = 2;
39
void setup() {
40
// declare inputs
41
pinMode(erasePin, INPUT);
42
+ digitalWrite(erasePin, HIGH);
43
// initialize the screen
44
TFTscreen.begin();
45
// make the background black
@@ -51,8 +52,8 @@ void loop() {
51
52
int yValue = analogRead(A1);
53
54
// map the values and update the position
- xPos = xPos + (map(xValue, 0, 1023, 2, -2));
55
- yPos = yPos + (map(yValue, 0, 1023, -2, 2));
+ xPos = xPos + (map(xValue, 0, 1023, 2, -3));
56
+ yPos = yPos + (map(yValue, 0, 1023, -2, 3));
57
58
// don't let the point go past the screen edges
59
if (xPos > 159) {
@@ -75,7 +76,7 @@ void loop() {
75
76
TFTscreen.point(xPos, yPos);
77
78
// read the value of the pin, and erase the screen if pressed
- if (digitalRead(erasePin) == HIGH) {
79
+ if (digitalRead(erasePin) == LOW) {
80
TFTscreen.background(0, 0, 0);
81
}
82
0 commit comments