diff --git a/examples/LVGL_Arduino.ino b/examples/LVGL_Arduino.ino index 4e777c19e..658fd9d8e 100644 --- a/examples/LVGL_Arduino.ino +++ b/examples/LVGL_Arduino.ino @@ -36,26 +36,11 @@ bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) bool touched = tft.getTouch(&touchX, &touchY, 600); - if(!touched) - { + if(!touched) { data->state = LV_INDEV_STATE_REL; - return false; - } - else - { + } else { data->state = LV_INDEV_STATE_PR; - } - - if(touchX>screenWidth || touchY > screenHeight) - { - Serial.println("Y or y outside of expected parameters.."); - Serial.print("y:"); - Serial.print(touchX); - Serial.print(" x:"); - Serial.print(touchY); - } - else - { + /*Set the coordinates*/ data->point.x = touchX; data->point.y = touchY; @@ -65,7 +50,6 @@ bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) Serial.print("Data y"); Serial.println(touchY); - } return false; /*Return `false` because we are not buffering and no more data to read*/