#include <otSerial.h> #include <otPrintfLite.h> #include <otTimer.h> #include <otXPT2046.h> otXPT2046 ts; void setup() { // Setup the UART0 used by printf UartEnableSignals(UART0); UartSetBaud(UART0, 115200); // Init printf setStdout(UART0); // printf output is now directed on UART0 ts.init(240, 320); } void loop() { U16 x, y, z; if(ts.rawData(x, y, z)) printf("x = %4d, y = %4d, z = %4d\n", x, y, z); DelayMs(10); if(ts.position(x, y)) printf("x = %4d, y = %4d\n", x, y); DelayMs(100); }