IL3941 display

I have a IL3941 display from Adafruit and have it hooked up to an Arduino Mega. I have checked the wiring twice and the example code graphic text is running but it is a mirror image?! Any suggestions.
Here is the setup portion of the code.

  This is our library for the Adafruit HX8357D Breakout

  Check out the links above for our tutorials and wiring diagrams
  These displays use SPI to communicate, 4 or 5 pins are required to
  interface (RST is optional)
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.
  MIT license, all text above must be included in any redistribution

#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_HX8357.h"

// These are 'flexible' lines that can be changed
#define TFT_CS 10
#define TFT_DC 9
#define TFT_RST 8 // RST can be set to -1 if you tie it to Arduino's reset

// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_HX8357 tft = Adafruit_HX8357(TFT_CS, TFT_DC, TFT_RST);

void setup() {
  Serial.println("HX8357D Test!"); 


  // read diagnostics (optional but can help debug problems)
  uint8_t x = tft.readcommand8(HX8357_RDPOWMODE);
  Serial.print("Display Power Mode: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(HX8357_RDMADCTL);
  Serial.print("MADCTL Mode: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(HX8357_RDCOLMOD);
  Serial.print("Pixel Format: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(HX8357_RDDIM);
  Serial.print("Image Format: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(HX8357_RDDSDR);
  Serial.print("Self Diagnostic: 0x"); Serial.println(x, HEX); 
  Serial.println(F("Benchmark                Time (microseconds)"));


  Serial.print(F("Text                     "));

  Serial.print(F("Lines                    "));

  Serial.print(F("Rectangles (outline)     "));

  Serial.print(F("Circles (outline)        "));
  Serial.println(testCircles(10, HX8357_RED));

  Serial.print(F("Triangles (outline)      "));

  Serial.print(F("Triangles (filled)       "));

  Serial.print(F("Rounded rects (outline)  "));

  Serial.print(F("Rounded rects (filled)   "));



What does tft.setRotation do ?

The OP is talking about a IL3941 and then using a library for an HX8357-D.

Please post a link to the actual display that you have bought.
If it is a genuine Adafruit product, it will have the appropriate 3.3V level-shifting hardware.
Adafruit always provides good documentation, libraries and examples.

Oh, we all make typos. Please correct any mis-spelled part numbers.


My screen is the ILI9341. I am using the libraries and example that Adafruit provided. Manipulating tft.setRotation() moves the starting position to different corners of the screen but the printout is a mirror image. Does anyone know of a function in this library that will flip the mirrored image. I have searched the Adafruit tutorials but come up empty.

From the original post:

#include "Adafruit_HX8357.h"

This will definitely NOT work with an ILI9341.

Please correct the thread title. And any other typos.

And yes, we would still like to see a link to your actual Adafruit display.

I do not own any Adafruit ILI9341 displays. However I bet you several warm beers that the Adafruit code will work 100% with their products.


Figured it out finally. I had the wrong library included. I dumped it and installed the ILI9341 library and started from scratch. Now its working. Thanks for the help.

Sorry but..