Skip to content

Commit 4dd21db

Browse files
authored
prettier
1 parent 6f7873a commit 4dd21db

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

libraries/NS2009/examples/drawline/drawline.ino

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void setup()
2020
pinMode(key, INPUT);
2121
lcd.begin(15000000, COLOR_RED);
2222
touchscreen.begin();
23-
touchscreen.calibrate(320,240);
23+
touchscreen.calibrate(320, 240);
2424
}
2525

2626
void loop()
@@ -29,20 +29,16 @@ void loop()
2929
touchscreen_status = touchscreen.getStatus();
3030
touchscreen_x = touchscreen.getX();
3131
touchscreen_y = touchscreen.getY();
32-
if(draw){
32+
if (draw) {
3333
lcd.writeLine(x_last,y_last,touchscreen_x,touchscreen_y,COLOR_WHITE);
3434
}
35-
if(status_last!=touchscreen_status){
36-
if (touchscreen_status == TOUCH_BEGIN || touchscreen_status == TOUCH_MOVE)
37-
draw = true;
38-
else
39-
draw = false;
40-
status_last=touchscreen_status;
35+
if (status_last != touchscreen_status) {
36+
draw = (touchscreen_status == TOUCH_BEGIN || touchscreen_status == TOUCH_MOVE);
37+
status_last = touchscreen_status;
4138
}
4239
x_last = touchscreen_x;
4340
y_last = touchscreen_y;
44-
if(digitalRead(key) == LOW)
45-
{
41+
if (digitalRead(key) == LOW) {
4642
lcd.fillScreen(COLOR_BLACK);
4743
}
4844
}

0 commit comments

Comments
 (0)