// # include <Adafruit_ILI9341.h>
#include <ILI9341_t3n.h>
// Adafruit_ILI9341 display = Adafruit_ILI9341 (TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
ILI9341_t3n display = ILI9341_t3n (TFT_CS, TFT_DC, TFT_RST, TFT_MOSI, TFT_CLK, TFT_MISO);
DMAMEM uint16_t tft_frame_buffer [ILI9341_TFTWIDTH * ILI9341_TFTHEIGHT];
//Serial.begin(9600);
display.begin ();
display.setFrameBuffer (tft_frame_buffer);
but then I don't know how to do it.
void loop () {
// if programming failed, don't try to do anything
if (! dmpReady) return;
// wait for MPU interrupt or extra packet (s) available
while (! mpuInterrupt && fifoCount <packetSize) {
// other program behavior stuff here
}
// reset interrupt flag and get INT_STATUS byte
mpuInterrupt = false;
mpuIntStatus = mpu.getIntStatus ();
// get current FIFO count
fifoCount = mpu.getFIFOCount ();
//
// check for overflow (this should never happen unless our code is too inefficient)
if ((mpuIntStatus & 0x10) || fifoCount == 1024) {
// reset so we can continue cleanly
mpu.resetFIFO ();
//Serial.println(F("FIFO overflow! "));
// otherwise, check for DMP data ready interrupt (this should happen frequently)
} else if (mpuIntStatus & 0x02) {
// wait for correct available data length, should be a VERY short wait
while (fifoCount <packetSize) fifoCount = mpu.getFIFOCount ();
// read a packet from FIFO
mpu.getFIFOBytes (fifoBuffer, packetSize);
mpu.resetFIFO (); // *** more line to avoid bug !! ***
// track FIFO count here in case there is> 1 packet available
// (this lets us immediately read more without waiting for an interrupt)
fifoCount - = packetSize;
#ifdef OUTPUT_READABLE_YAWPITCHROLL
// display Euler angles in degrees
mpu.dmpGetQuaternion (& q, fifoBuffer);
mpu.dmpGetGravity (& gravity, & q);
mpu.dmpGetYawPitchRoll (ypr, & q, & gravity);
#endif
rotation();
}
/*sample code
void rotation(){
///////
display.drawLine(oldrcd , oldrsd, oldrc , oldrs , BLACK);
display.drawLine(rcd , rsd, rc , rs , WHITE);
display.setTextColor(BLACK);
display.setCursor(oldNx, oldNy);
display.print("N");
display.setTextColor(WHITE);
display.setCursor(Nx, Ny);
display.print("N");
////////
}