Adafruit 2.
Guide Contents Guide Contents Overview Pinouts Power Pins SPI Pins TFT Control Pins Touch Screen control pins SD Card control pins TFT Graphics Test Install Libraries Install Adafruit ILI9341 TFT Library Basic Graphics Test Adafruit GFX Library Resistive Touch Screen Touchscreen Paint Demo Drawing Bitmaps Downloads Datasheets & More Schematic Fabrication Print © Adafruit Industries https://learn.adafruit.
Overview A Feather board without ambition is a Feather board without FeatherWings! Spice up your Feather project with a beautiful 2.4" touchscreen display shield with built in microSD card socket. This TFT display is 2.4" diagonal with a bright 4 white-LED backlight. You get 240x320 pixels with individual 16-bit color pixel control. It has way more resolution than a black and white 128x64 display.
This FeatherWing uses a SPI display, touchscreen and SD card socket so it works nice and fast on all our Feathers (including nRF52, ESP8266, 32u4, 328p, M0, M4, WICED and Teensy 3.x) We also include an SPI resistive touchscreen controller so you only need one additional pin to add a high quality touchscreen controller. One more pin is used for an optional SD card that can be used for storing images for display. This Wing comes fully assembled with dual sockets for your Feather to plug into.
Four mounting holes make it easy to attach this Wing anywhere. We also include a big reset button and an on/off switch connected to the Feather Enable pin (note that the Teensy 3.x Feather does not use the Enable pin so the switch will not do anything with that type). © Adafruit Industries https://learn.adafruit.
Pinouts Unlike most FeatherWings, the TFT FeatherWing is fully assembled and has a dual socket set for your Feather to plug into. This makes it really easy to use, but a little different to change if you don't want the default setup Power Pins All power for the FeatherWing comes from the 3.3V and GND pins. That includes the backlight (which can draw up to 100mA)! © Adafruit Industries https://learn.adafruit.
You can turn off the 3.3V power supply with the EN pin or the switch attached to that pin. Note that on the Teensy 3x Feather Adapter, this pin doesn't do anything and on the FONA feather, this will not disable the VBAT power supply which is used to power the cellular module SPI Pins © Adafruit Industries https://learn.adafruit.
The TFT display, SD card and touch screen use the SPI interface to communicate. That means MISO, MOSI and SCK are used whenever either are accessed. TFT Control Pins © Adafruit Industries https://learn.adafruit.
In addition, for the TFT display there is are D/C (Data/Command) and CS (Chip Select) pins. These are used to select the display and tell it what kind of data is being sent. These pins can theoretically be changed by cutting the jumper trace and soldering a small wire from the right-hand pad to the pin you'd like to use.
The touch screen also has a Chip Select line, labeled RT. This pin can theoretically be changed by cutting the jumper trance and soldering a small wire from the right-hand pad to the pin you'd like to use.
The SD Card also has a Chip Select line, labeled SD. This pin can theoretically be changed by cutting the jumper trance and soldering a small wire from the right-hand pad to the pin you'd like to use.
TFT Graphics Test The TFT FeatherWing is basically a combination of our 2.4" TFT Breakout (https://adafru.it/sjD) with the STMPE610 resistive touch-screen breakout attached (http://adafru.it/1571). Install Libraries You'll need a few libraries to use this FeatherWing! Install Adafruit ILI9341 TFT Library We have example code ready to go for use with these TFTs. From within the Arduino IDE, open up the Library Manager...
Restart the IDE Basic Graphics Test After restarting the Arduino software, you should see a new example folder called Adafruit_ILI9341 and inside, an example called graphicstest_featherwing. Upload that sketch to your Feather. You should see a collection of graphical tests draw out on the TFT. © Adafruit Industries https://learn.adafruit.
If you're having difficulties, check the serial console.The first thing the sketch does is read the driver configuration from the TFT, you should see the same numbers as below. That will help you determine if the TFT is found, if not, check your Feather soldering! Once you've got the demo working, check out the detailed documentation over at http://learn.adafruit.com/adafruit-gfxgraphics-library (https://adafru.
Adafruit GFX Library The Adafruit_GFX library for Arduino provides a common syntax and set of graphics functions for all of our TFT, LCD and OLED displays. This allows Arduino sketches to easily be adapted between display types with minimal fuss…and any new features, performance improvements and bug fixes will immediately apply across our complete offering of color displays. The GFX library is what lets you draw points, lines, rectangles, round-rects, triangles, text, etc.
Check out our detailed tutorial here http://learn.adafruit.com/adafruit-gfx-graphics-library (https://adafru.it/aPx) It covers the latest and greatest of the GFX library. The GFX library is used in both 8-bit and SPI modes so the underlying commands (drawLine() for example) are identical! © Adafruit Industries https://learn.adafruit.
Resistive Touch Screen The LCD has a 4-wire resistive touch screen glued onto it. You can use this for detecting finger-presses, stylus', etc. Normally, you'll need 4 pins to talk to the touch panel but we decided to go all snazzy and put a dedicated touch screen driver onto the shield. The driver shares the SPI pins with the TFT and SD card, so only one extra pin is needed. This allows you to query the controller when you're ready to read touchscreen data, and saves 3 pins.
The touch screen is made of a thin glass sheet, and its very fragile - a small crack or break will make the entire touch screen unusable. Don't drop or roughly handle the TFT and be especially careful of the corners and edges. When pressing on the touchscreen, sometimes people can use the tip of their fingers, or a fingernail. If you don't find the touchscreen responds well to your fingers, you can use a rounded stylus which will certainly work.
To get the oldest point from the buffer. TS_Point has .x .y and .z data points. The x and y points range from 0 to 4095. The STMPE610 does not store any calibration data in it and it doesn't know about rotation. So if you want to rotate the screen you'll need to manually rotate the x/y points! The z point is 'pressure' and ranges from 0 to 255, we don't use it here but you can experiment with it on your own, the harder you press, the lower the number.
Drawing Bitmaps There is a built in microSD card slot into the shield, and we can use that to load bitmap images! You will need a microSD card formatted FAT16 or FAT32 (they almost always are by default). Its really easy to draw bitmaps. Lets start by downloading this image of pretty flowers (pix by johngineer) Save and rename it to purple.bmp into the base directory of a microSD card and insert it into the microSD socket in the shield.
You can draw as many images as you want - dont forget the names must be less than 8 characters long. Just copy the BMP drawing routines below loop() and call bmpDraw(bmpfilename, x, y); For each bitmap. They can be smaller than 320x240 and placed in any location on the screen. © Adafruit Industries https://learn.adafruit.
Downloads Datasheets & More Fritzing object in Adafruit Fritzing Library (https://adafru.it/c7M) STMPE610 Touch Controller Datasheet (https://adafru.it/d4k) ILI9341 (TFT controller) Datasheet (https://adafru.it/d4l) Datasheet for TFT module itself (https://adafru.it/zAj) EagleCAD PCB files on GitHub (https://adafru.it/ska) Schematic Fabrication Print © Adafruit Industries https://learn.adafruit.
© Adafruit Industries Last Updated: 2018-12-12 04:13:20 AM UTC Page 23 of 23