Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 1 of 1

Thread: Problem with ILI9341_t3 library and Teensy 3.6

  1. #1
    Junior Member
    Join Date
    Aug 2020
    Location
    Tucson, Az USA
    Posts
    2

    Problem with ILI9341_t3 library and Teensy 3.6

    I am developing a PID controller using a 320x240 TFT SPI display that I originally ran on an Arduino Due.
    however on a Teensy 3.6y 3.6 I ran into display problems when I started using the INI9341_t3 library.

    When I run a simple program using the teensyduino ILI9341_t3 library all I get is garbage on the TFT screen.
    Click image for larger version. 

Name:	ILI9341t3.jpeg 
Views:	7 
Size:	66.3 KB 
ID:	21313
    running the same program, but using the adafruit ILI9341 library, everything works.
    Click image for larger version. 

Name:	adafruit.jpeg 
Views:	2 
Size:	83.4 KB 
ID:	21312
    I Also tried running the example graphicstest from both the teensyduino ILI931_t3 and Adafruit libraries. Again the Adafruit works and the other does not.
    Any thoughts on what is wrong?
    Here is the ILI931_t3 code

    Code:
    #include <Arduino.h>
    #include "SPI.h"
    #include "ILI9341_t3.h"
    #include "font_Arial.h"
    
    // For the Adafruit shield, these are the default.
    #define TFT_DC  9
    #define TFT_CS 10
    
    // Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
    ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC);
    
    void testText(){
      tft.fillScreen(ILI9341_BLACK);
      tft.setTextColor(ILI9341_YELLOW);
      tft.setTextSize(3);
      tft.setCursor(5, 0);
      tft.println(" Teensy test");
      tft.setCursor(10,30);
      tft.setTextColor(ILI9341_GREENYELLOW);
      tft.setTextSize(2);
      tft.println("Teensy ILI9431_t3 library");
    
    
    }
    void setup() {
      // put your setup code here, to run once:
      tft.begin();
      testText();
    }
    
    void loop() {
      // put your main code here, to run repeatedly:
      for(uint8_t rotation=0; rotation<4; rotation++) {
        tft.setRotation(rotation);
        testText();
        delay(1000);
      }
    
    }

    and the Adafruit code

    Code:
    #include <Arduino.h>
    #include "SPI.h"
    #include "Adafruit_GFX.h"
    #include "Adafruit_ILI9341.h"
    
    // For the Adafruit shield, these are the default.
    #define TFT_DC  9
    #define TFT_CS 10
    
    // Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
    Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
    
    void testText(){
      tft.fillScreen(ILI9341_BLACK);
      tft.setTextColor(ILI9341_YELLOW);
      tft.setTextSize(3);
      tft.setCursor(5, 0);
      tft.println(" Teensy test");
      tft.setCursor(10,30);
      tft.setTextColor(ILI9341_GREENYELLOW);
      tft.setTextSize(2);
      tft.println("Teensy ILI9431_t3 library");
    
    
    }
    void setup() {
      // put your setup code here, to run once:
      tft.begin();
      testText();
    }
    
    void loop() {
      // put your main code here, to run repeatedly:
      for(uint8_t rotation=0; rotation<4; rotation++) {
        tft.setRotation(rotation);
        testText();
        delay(1000);
      }
    
    }
    any thoughts?
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •