diff --git a/tests/arduino_touchscreen_test/arduino_touchscreen_test.ino b/tests/arduino_touchscreen_test/arduino_touchscreen_test.ino new file mode 100644 index 0000000..24ef00c --- /dev/null +++ b/tests/arduino_touchscreen_test/arduino_touchscreen_test.ino @@ -0,0 +1,38 @@ +void setup() { + // put your setup code here, to run once: + Serial.begin(9600); + Serial.println("\"setup\""); + +} + +class Panel { + int A,B; +public: + Panel(int one, int two) : A(one), B(two) { + pinMode(A, OUTPUT); + pinMode(B, OUTPUT); + } + + int Y() { + digitalWrite(A, 1); + int result = analogRead(B); + digitalWrite(A, 0); + return result; + } + + int X() { + digitalWrite(B, 1); + int result = analogRead(A); + digitalWrite(B, 0); + return result; + } + +} panel(A0,A1); + +void loop() { + // put your main code here, to run repeatedly: + Serial.print(panel.X()); + Serial.print("\t"); + Serial.println(panel.Y()); + delay(100); +}