AdaFruit 2.8" IL9341 SPI help

MisterBulldops

New member
ok so, I would thank you for your patience if you wish to help me. I wouldn't bother you if i wasn't stuck in a bind

Bought this thing:

https://www.adafruit.com/product/2090

how do I define the pins on a 4.1 in code for SPI? i've made my boards already. I just want to write to the screen, not read anything back through SPI. The nomenclature from the example code on github doesn't seem intuitive to me (but like i said, im dumb). I think the default pins in the below code are for an Uno maybe.

https://github.com/adafruit/Adafruit_ILI9341

#include <Adafruit_ILI9341.h>

#ifdef ADAFRUIT_PYPORTAL
#define TFT_D0 34 // Data bit 0 pin (MUST be on PORT byte boundary)
#define TFT_WR 26 // Write-strobe pin (CCL-inverted timer output)
#define TFT_DC 10 // Data/command pin
#define TFT_CS 11 // Chip-select pin
#define TFT_RST 24 // Reset pin
#define TFT_RD 9 // Read-strobe pin
#define TFT_BACKLIGHT 25
// ILI9341 with 8-bit parallel interface:
Adafruit_ILI9341 tft = Adafruit_ILI9341(tft8bitbus, TFT_D0, TFT_WR, TFT_DC, TFT_CS, TFT_RST, TFT_RD);
#define USE_BUFFER // buffer all 155 KB of data for bliting - uses passive ram but looks nicer?
#else
// Use SPI
#define STMPE_CS 6
#define TFT_CS 9
#define TFT_DC 10
#define SD_CS 5
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
#endif



Hey thanks if you can help
 
Perhaps this page will help.
And there are examples in File > Examples > ILI9341_t3.

If you installed the Adafruit ILI9341 library, there are examples in File > Examples > Adafruit ILI9341.
Example "graphicstest" states:
Code:
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

// For the Adafruit shield, these are the default.
[COLOR="#FF0000"]#define TFT_DC 9
#define TFT_CS 10[/COLOR]

// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
[COLOR="#FF0000"]Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);[/COLOR]
// If using the breakout, change pins as desired
//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);

This will work for Teensy as well.

Paul
 
Back
Top