v1: Live ADS-B radar with detail panel, units, legend, proximity LED alert
This commit is contained in:
32
src/touch_input.h
Normal file
32
src/touch_input.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
|
||||
namespace TouchInput {
|
||||
|
||||
struct Point {
|
||||
int16_t x = 0;
|
||||
int16_t y = 0;
|
||||
bool touched = false;
|
||||
};
|
||||
|
||||
void begin();
|
||||
|
||||
// Laedt calibration.txt von der SD-Karte. Gibt false zurueck, wenn keine
|
||||
// vorhanden oder ungueltig ist.
|
||||
bool loadCalibration();
|
||||
void setCalibration(int16_t rawXmin, int16_t rawXmax, int16_t rawYmin, int16_t rawYmax);
|
||||
void saveCalibration();
|
||||
bool hasCalibration();
|
||||
|
||||
// Aktueller Touch-Zustand, roh (unkalibriert), z.B. fuer die
|
||||
// Kalibrierungs-Routine selbst.
|
||||
Point rawPoint();
|
||||
|
||||
// Aktueller Touch-Zustand, auf Bildschirmkoordinaten (0..SCREEN_WIDTH-1 /
|
||||
// 0..SCREEN_HEIGHT-1) umgerechnet und geclampt.
|
||||
Point mappedPoint();
|
||||
|
||||
// Liefert genau einmal pro physischer Beruehrung "true" (beim Loslassen),
|
||||
// mitsamt der zuletzt bekannten Position. Fuer Buttons/Tastatur gedacht.
|
||||
bool wasTapped(Point& outPoint);
|
||||
}
|
||||
Reference in New Issue
Block a user