From 4dd21db55eb9f57d90ce3bd6ca1d041eead67b94 Mon Sep 17 00:00:00 2001 From: Van Vuong Ngo Date: Fri, 11 Oct 2019 06:07:55 +0200 Subject: [PATCH] prettier --- libraries/NS2009/examples/drawline/drawline.ino | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/libraries/NS2009/examples/drawline/drawline.ino b/libraries/NS2009/examples/drawline/drawline.ino index bd586c1..b23ac72 100644 --- a/libraries/NS2009/examples/drawline/drawline.ino +++ b/libraries/NS2009/examples/drawline/drawline.ino @@ -20,7 +20,7 @@ void setup() pinMode(key, INPUT); lcd.begin(15000000, COLOR_RED); touchscreen.begin(); - touchscreen.calibrate(320,240); + touchscreen.calibrate(320, 240); } void loop() @@ -29,20 +29,16 @@ void loop() touchscreen_status = touchscreen.getStatus(); touchscreen_x = touchscreen.getX(); touchscreen_y = touchscreen.getY(); - if(draw){ + if (draw) { lcd.writeLine(x_last,y_last,touchscreen_x,touchscreen_y,COLOR_WHITE); } - if(status_last!=touchscreen_status){ - if (touchscreen_status == TOUCH_BEGIN || touchscreen_status == TOUCH_MOVE) - draw = true; - else - draw = false; - status_last=touchscreen_status; + if (status_last != touchscreen_status) { + draw = (touchscreen_status == TOUCH_BEGIN || touchscreen_status == TOUCH_MOVE); + status_last = touchscreen_status; } x_last = touchscreen_x; y_last = touchscreen_y; - if(digitalRead(key) == LOW) - { + if (digitalRead(key) == LOW) { lcd.fillScreen(COLOR_BLACK); } }