Touchscreen digit recognition.
Dependencies: mbed TFT_fonts SPI_TFT_ILI9341 Adafruit_GFX FT6206 MMA8451Q
orientation.cpp
00001 #include "orientation.hpp" 00002 00003 int get_orientation() { 00004 static bool horizontal = true; 00005 float x = abs(acc.getAccX()); 00006 float y = abs(acc.getAccY()); 00007 float z = abs(acc.getAccZ()); 00008 horizontal = z < 0.5 ? y > x : horizontal; 00009 return horizontal ? LANDSCAPE : PORTRAIT; 00010 }
Generated on Thu Jul 14 2022 14:36:11 by 1.7.2