2.4 tft lcd shield library quotation

Spice up your Arduino project with a beautiful touchscreen display shield with built in microSD card connection. This TFT display is 2.4" diagonal and colorful (18-bit 262,000 different shades)! 240x320 pixels with individual pixel control. As a bonus, this display has a optional capacitive touch panel and resistive touch panel with controller XPT2046 attached by default.

The shield is fully assembled, tested and ready to go. No wiring, no soldering! Simply plug it in and load up our library - you"ll have it running in under 10 minutes! Works best with any classic Arduino (UNO/Due/Mega 2560).

This display shield has a controller built into it with RAM buffering, so that almost no work is done by the microcontroller. You can connect more sensors, buttons and LEDs.

Of course, we wouldn"t just leave you with a datasheet and a "good luck!" - we"ve written a full open source graphics library at the bottom of this page that can draw pixels, lines, rectangles, circles and text. We also have a touch screen library that detects x,y and z (pressure) and example code to demonstrate all of it. The code is written for Arduino but can be easily ported to your favorite microcontroller!

2.4 tft lcd shield library quotation

Spice up your Arduino project with a beautiful touchscreen display shield with built in microSD card connection. This IPS TFT display is 2.4" diagonal and colorful (18-bit 262,000 different shades)! 240x320 pixels with individual pixel control. As a bonus, this display has a optional capacitive touch panel and resistive touch panel with controller XPT2046 attached by default.

The shield is fully assembled, tested and ready to go. No wiring, no soldering! Simply plug it in and load up our library - you"ll have it running in under 10 minutes! Works best with any classic Arduino (UNO/Due/Mega 2560).

This display shield has a controller built into it with RAM buffering, so that almost no work is done by the microcontroller. You can connect more sensors, buttons and LEDs.

Of course, we wouldn"t just leave you with a datasheet and a "good luck!" - we"ve written a full open source graphics library at the bottom of this page that can draw pixels, lines, rectangles, circles and text. We also have a touch screen library that detects x,y and z (pressure) and example code to demonstrate all of it. The code is written for Arduino but can be easily ported to your favorite microcontroller!

1.2.4 inch arduino shield with resistive touch panel could only support Due board. It can support DUE,UNO,MEGA2560 boad if matched with capacitive touch panel.

2.4 tft lcd shield library quotation

Mine have a S6D0154 controller. The library was from "https://github.com/samuraijap/TFTLCD-Library". For Arduino UNO, you need to install both libraries attached, then replace the file "pin_magic.h" from the installation folder "libraries\TFTLCD-Library-master", with the "pin_magic.h" file attached here.

2.4 tft lcd shield library quotation

The shield is fully assembled, tested, and ready to go. No wiring, no soldering! Simply plug it in and load up the library - you"ll have it running in under 10 minutes!

2.4 tft lcd shield library quotation

I"ll show you how to get started with a very popular variant of the TFT touch screen, including how to make a "button" (spoiler alert: it"s not a button just an area of screen that looks like one, that you can then receive touches from).

2.4 tft lcd shield library quotation

In this Arduino touch screen tutorial we will learn how to use TFT LCD Touch Screen with Arduino. You can watch the following video or read the written tutorial below.

As an example I am using a 3.2” TFT Touch Screen in a combination with a TFT LCD Arduino Mega Shield. We need a shield because the TFT Touch screen works at 3.3V and the Arduino Mega outputs are 5 V. For the first example I have the HC-SR04 ultrasonic sensor, then for the second example an RGB LED with three resistors and a push button for the game example. Also I had to make a custom made pin header like this, by soldering pin headers and bend on of them so I could insert them in between the Arduino Board and the TFT Shield.

Here’s the circuit schematic. We will use the GND pin, the digital pins from 8 to 13, as well as the pin number 14. As the 5V pins are already used by the TFT Screen I will use the pin number 13 as VCC, by setting it right away high in the setup section of code.

I will use the UTFT and URTouch libraries made by Henning Karlsen. Here I would like to say thanks to him for the incredible work he has done. The libraries enable really easy use of the TFT Screens, and they work with many different TFT screens sizes, shields and controllers. You can download these libraries from his website, RinkyDinkElectronics.com and also find a lot of demo examples and detailed documentation of how to use them.

After we include the libraries we need to create UTFT and URTouch objects. The parameters of these objects depends on the model of the TFT Screen and Shield and these details can be also found in the documentation of the libraries.

So now I will explain how we can make the home screen of the program. With the setBackColor() function we need to set the background color of the text, black one in our case. Then we need to set the color to white, set the big font and using the print() function, we will print the string “Arduino TFT Tutorial” at the center of the screen and 10 pixels  down the Y – Axis of the screen. Next we will set the color to red and draw the red line below the text. After that we need to set the color back to white, and print the two other strings, “by HowToMechatronics.com” using the small font and “Select Example” using the big font.

2.4 tft lcd shield library quotation

Features: 2.4 diagonal LCD TFT display Bright, 4 white-LED backlight, on by default but you can connect the transistor to a digital pin for backlight control Colorful, 18-bit 262,000 dierent shades 4-wire resistive touchscreen 240320 resolution spfd5408 controller with built in video RAM buer 8 bit digital interface, plus 4 control lines Uses digital pins 5-13 and analog 0-3. That means you can use digital pins 2, 3 and analog 4 and 5. Pin 12 is available if not using the micro SD 5V compatible, use with 3.3V or 5V logic Onboard 3.3V @ 300mA LDO regulator Speci cations: Size: 71*52*7mm Weight: about 31gLibraries Included (Kind of)

The shield came packed with one of those tiny CD ROM discs with a few dierent RAR les on it. The one with arduino-UNO in the name seemed like the most likelycandidate, so I opened it up and started poking around.

After some trial and error, including nding the correct library, changing library names, altering include le references, etc., I managed to get something on the screen. I made many small tweaks to the LCD library to make my life a little easier (see below), but the many references to Adafruit in the code led me to give their web site a look. There I found a library for a 2.8 touch screen that looks very similar to this one. Im not sure the code in their libraries will work without modication, but they may be worth taking a look at.

Compare the original image below to the 16-bit screen representation to its right. While the picture of the LCD screen doesnt really do it justice, it should give you anidea of what youll see. The rst thing that will likely draw your attention about the screen image is the very noticeable banding. This becomes less apparent with linedrawings using a simpler color palette, but it is very visible when viewing bitmaps or lling the screen with a solid color.

SD Card SlotThe shield comes equipped with a micro SD card slot, which I really had no real intention of using when I bought it. My curiosity quickly took over, however, and I triedto run some of the sample code. Unfortunately, I didnt meet with any success during my initial attempts to get it working and threw in the towel completely afterpushing a bit too hard on the card as I inserted it, breaking the connector o the board.

Im still not sure exactly what driver chip my LCD is using. The libraries included with the unit expand into a directory called arduino-9320. I originally took this tomean that it used the ILI9320 chip and started working from the data sheet I found here to expand functionality as needed. However, some of the sample code does adriver check before proceeding, as follows:

1 // find the TFT display ? 2 uint16_t identifier = tft.readRegister(0x0); 3 if (identifier == 0x9325) { 4 Serial.println("Found ILI9325"); 5 } else if (identifier == 0x9328) { 6 Serial.println("Found ILI9328"); 7 } else { 8 Serial.print("Unknown driver chip "); 9 Serial.println(identifier, HEX); 10 while (1); 11 }

I have made some modications to the library included with the board, and Ill include my les below. It wasnt until after Id started monkeying with things andnoticing references to Adafruit in the code, that I realized there may be better options already out there. Whether or not they work with this screen is something I haveyet to determine.

The TFT library includes functions for drawing lines, rectangles, rounded rectangles, circles and triangles, all of which can be lled or outlined. There is example codethat cycles through various screen patterns using each.

After I got the SD card reader working, I spent some time concentrating on loading bitmaps. The sample code that comes with the library has a few examples that load24-bit bitmap les from the SD card and display them on the screen in various rotations. These samples didnt work correctly until I modied the code to use thesetPixel method, which resulted in a very slow display time but worked in all screen rotations.

The rs thing I did was switch away from the 24-bit bitmap format. The display uses a 16-bit RGB format (R5G6B5), so it makes more sense to do that transformationsomewhere other than the Arduino if youre just worried about getting it onto the screen as quickly as possible. Furthermore, the standard Windows bitmap le isstored in a bottom-up format, which adds a little complexity to the direct write method. So, I wrote a little utility to convert my bitmap les to a 16-bit, top-downformat that could be directly loaded into the LCDs GRAM. You can nd that utility here.

Moving to the 16-bit format had a huge impact on performance, though I didnt think to take any timings in this state, as I wasnt quite done. My next step was tosimplify loading by getting rid of the position calculations required for bitmaps that didnt extend the entire width of the screen. The data sheet provides details aboutcreating a window within the screen, which you can specify the dimensions of. Combining this window setting with the GRAM access direction settings mentionedabove, it is possible to just send the pixel information in bulk and allow the LCD driver chip handle the wrapping.

The end result is fast, loading and displaying a 320240 scooter image in 1.3 seconds and the smaller picture over the top in 129 milliseconds. Ive since beenexperimenting with the sdfatlib library for SD card access, and the results have improved even further, bringing load/display time to 1.048 seconds. I was looking morefor a smaller footprint, but Ill take the the speed as well.Arduino Code

1 void displayBitmap(int x, int y) ? 2 { 3 uint16_t bx, ex, by, ey; 4 uint32_t time = millis(); 5 6 // Raw pixel data starts at position 8 7 bmpFile.seek(8); 8 9 // Save the current viewport settings and set 10 tft.getViewport(&bx, &ex, &by, &ey); 11 tft.setViewport(x, y, x + bmpWidth - 1, y + bmpHeight - 1); 12 tft.goTo(x, y); 13 14 // Bulk write data to LCD, loadBitmapData is a callback to refill buffer 15 int bytesRead = loadBitmapData(NULL); 16 tft.bulkWrite( (uint16_t *) picBuffer, bytesRead, loadBitmapData, NULL); 17 18 // Leave the viewport like we found it 19 tft.setViewport(bx, ex, by, ey); 20 21 Serial.print("Total time: "); 22 Serial.println(millis() - time, DEC); 23 24 }

1 // Writes 16-bit data in bulk, using callback to get more ? 2 void TFTLCD::bulkWrite(uint16_t *data, uint16_t bufferSize, uint16_t (*getNextValues)(void *), void *userData) 3 { 4 *portOutputRegister(csport) &= ~cspin; 5 *portOutputRegister(cdport) |= cdpin; 6 *portOutputRegister(rdport) |= rdpin; 7 *portOutputRegister(wrport) |= wrpin; 8 9 setWriteDir(); 10 while( bufferSize ) 11 { 12 for(uint16_t i=0; i < bufferSize; i++) 13 { 14 writeData_unsafe(data[i]); 15 } 16 bufferSize = getNextValues(userData); 17 } 18 *portOutputRegister(csport) |= cspin; 19 }

The display and touch screen features were what I was really looking for from this LCD, though I became somewhat sidetracked by the bitmap examples. The touchscreen example software ran pretty much without a hitch from the beginning using the pin settings for the shield. Essentially, you get two coordinates (X and Y) backfrom the screen, plus a Z, which indicates the pressure being applied. Those coordinates coincide with the LCDs default rotation, which is with the Arduinos USB plugon top in this case, so youll have to adjust those for yourself.

1 #include "TouchScreen.h" ? 2 3 // These are the pins for the shield! 4 #define YP A1 // must be an analog pin, use "An" notation! 5 #define XM A2 // must be an analog pin, use "An" notation! 6 #define YM 7 // can be a digital pin 7 #define XP 6 // can be a digital pin 8 9 #define MINPRESSURE 10 10 #define MAXPRESSURE 1000 11 12 // For better pressure precision, we need to know the resistance 13 // between X+ and X- Use any multimeter to read it 14 // For the one we"re using, its 300 ohms across the X plate 15 TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);

The one potential area for trouble is the fact that the touch screen shares pins with the LCD. So, if you invoke methods from the touch screen library, then make calls tothe LCD library, you may get unexpected results, as the touch screen library doesnt always leave things in the right state, and the LCD library doesnt put them in theright state before it does its work. The newer Adafruit libraries may account for this better than the ones Im using, but Ive worked around it for now.

1 Point getPressPosition() ? 2 { 3 4 Point p, q; 5 int upCount = 0; 6 7 // Wait for screen press 8 do 9 { 10 q = ts.getPoint(); 11 delay(10); 12 } while( q.z < MINPRESSURE || q.z > MAXPRESSURE ); 13 14 // Save initial touch point 15 p.x = q.x; p.y = q.y; p.z = q.z; 16 17 // Wait for finger to come up 18 do 19 { 20 q = ts.getPoint(); 21 if ( q.z < MINPRESSURE || q.z > MAXPRESSURE ) 22 { 23 upCount++; 24 } 25 else 26 { 27 upCount = 0; 28 p.x = q.x; p.y = q.y; p.z = q.z; 28 p.x = q.x; p.y = q.y; p.z = q.z; 29 } 30 31 delay(10); // Try varying this delay 32 33 } while( upCount < 10 ); // and this count for different results. 34 35 p.x = map(p.x, tsMinX, tsMaxX, 0, 239); 36 p.y = map(p.y, tsMinY, tsMaxY, 0, 319); 37 38 // I"ve been focused on rotation 3, with the USB connector on the right-hand side 39 // so, you"ll have to add your own code here. 40 switch( ROTATION ) 41 { 42 case 3: 43 swap(p.x, p.y); 44 p.x = (320 - p.x); 45 break; 46 } 47 48 // Clean up pin modes for LCD 49 pinMode(XM, OUTPUT); 50 digitalWrite(XM, LOW); 51 pinMode(YP, OUTPUT); 52 digitalWrite(YP, HIGH); 53 pinMode(YM, OUTPUT); 54 digitalWrite(YM, LOW); 55 pinMode(XP, OUTPUT); 56 digitalWrite(XP, HIGH); 57 58 return p; 59 }SD Card

As I mentioned, the SD card wasnt something I was necessarily looking for from this shield, but it has proven to be a blessing. It works with the standard Arduino SDlibrary, and Ive also tried the sdfatlib with great results. The cable select should be set to pin 10, and after that, youre ready to go. There is an example calledlistles that spits out a directory listing, which is great for both testing that the card works, and as a reminder that youre limited abbreviated le names that turn aname like BURG_BLUE.BMP into BURG_B~1.BMP.

I have attached the TFTLCD libraries with the modications Ive made for rotation and positioning reliability as well as the bulk data load function Im using fordisplaying bitmaps. Sample sketches are also included and should work with this LCD without modication.

There seem to be variants of this shield that look the same or similar but function dierently. Many users have had issues with reversed text and coordinate ippingusing the same library I originally provided. In the comments, Mike McCauley added a link to a patched version of the library that may x reverse coordinate issues. Ihave now added his patch into my library to avoid further confusion.

I was able to get this screen working as a shield with an Arduino Mega 2650 as well. I posted an article with an updated source le. Until I get some feedback, Illconsider it experimental. The article is here.

You may also like:Adding Mass Actions to Magento Bitmap Converter for Arduino LCD Touch Screen Shield for ArduinoOrders UNO

How did you go with the touchscreen code? I have the same shield but only get double characters when I press a number (doing the touch numeric keyboard thing aswell).Cheers,Darren.

Hey Justin Great post.I got the same lcd and my lcd co-ordinates appear reversed.I uncommented either and both of//#dene INVERT_X//#dene INVERT_Y these lines but it didnt work.It seems changing anything in TFTLCD.cpp le doesnt aect the code. Please help me . I am stuck at the same point from two weeks.

What do I need to compile the bmp2lcd utility in Windows? Can I use Atmel Studio or do I need another compiler? I want to try your 16 bit bmp method but dont knowexactly what to compile the source with.

Wow. Theres part of me that wonders if its even reading the register correctly. Im playing with the Adafruit library, and thats returning 0x0 for the ID, though Ivegotten it to produce graphics on the screen by forcing it to initialize properly. Sebastian December 28, 2013

Hi! Your work here helped me a lot! Right now Im modifying the Adafruit library to work with this shield, I replaced part of the code on the Adafruits with the_regValues[] and the initScreen from the CDs library and it worked! But I have the problem that X axis is mirrored, so the characters look backwards. If you havemade something to solve this orientation problem, it would help me a lot!

First, your English is great. I ran into the same problem with the Adafruit library when I tried it, but I havent had a chance to get back in and see what can be done to xthe backwards problem. Once the holiday season has passed and I get back to normal life, Ill take another look and update you.

I just picked up this same lcd. I also noticed that text is upside down and backwards. I discovered this blog (which is much appreciated, btw) because I was googlingspfd5408 arduino backwards. However, Im not certain that our displays are identical. Mine has some printed icons on the bottom and is intended to be used in aphone, in a portrait orientation. Im sure you would have mentioned if the text in the example program didnt appear correct.Any hooI started thinking about how the text in the graphic demo is displaying on MY screen. X=0 and Y=0 is actually the bottom left (when viewed in portrait). But I wouldprefer that the origin be at the top left and the display be viewed in a landscape orientation. So I looked at the code in TFTLCD.cpp for drawing characters and stringsand swapped X and Y by adding this line (as the rst line) to drawString() and drawChar():uint16_t t = x;x=y;y=t;

That works, but the fonts are sideways. So I then looked at the hex in glcdfont.cpp. For a moment, but only a moment, I considered that I really needed completelydierent font codes. The I looked more closely at drawChar() and just swapped the counters used to walk through the bits of each hex codevoid TFTLCD::drawChar(uint16_t x, uint16_t y, char c,uint16_t color, uint8_t size) {uint16_t t = x;x=y;y=t;//xy

Unfortunately, my coding skills are still in their infancy and I am unclear on implementing the changes you suggest I know how to edit the les, just not the preciselocation of any changes and /or additions to the code. I took a few stabs at it, but just get compiling errors. Any chance on further clarication of the exact changesrequired in the TFTLCD.ccp, and/or updated libraries?

I have been downloaded your library in rar format. It compiles satisfactorily problem is that SD Card is not working properly. The message shown by Arduino serial portmonitor is SD Card initilization failed. Although I selected proper chip select of SD Card. Kindly, tell me how can I achieve this goal. Your prompt reply is highlyappreciated.

Hi,I have the very same display (2 of them), Ive tried to download your library but my display stay stubbornly blank Ive tried on arduino uno, a clone of uno Butnothingh !

Thanks for your help, Ive tried your library and adafruit but I was not lucky. Perhaps I should start from scratch, or perhaps I was plainly cheated !

I really thank you for your really great work, im quite new at the Arduino world, so its impossible for me to make this type of things . I have the same shield/screen,and your library works really well, but there are stil 2 problems: I read in some comments above that some persons have the text upside down, and i have the same problem. As im new, i couldnt understand whats the solution, socould you please explain a bit how to solve it? I didnt understand how to use the touchscreen. Im using the Arduino Mega2560, so im using the pins a)-A4 and 22-29. which pins are used by the touchscreen, andhow do I use it? i saw that it shares pins with the LCD, but even if you explained somehow how to use it, im not an expert and cant use it

1. Go at the library folder, named TFTLCD;2. Open the le named TFTLCD.cpp with any text editor;3. Search for the function void TFTLCD::drawChar(uint16_t x, uint16_t y, char c, uint16_t color, uint8_t size) { [];4. Delete these lines:

void TFTLCD::drawChar(uint16_t x, uint16_t y, char c,uint16_t color, uint8_t size) {for (uint8_t i =0; i<5; i++ ) {uint8_t line = pgm_read_byte(font+(c*5)+i);for (uint8_t j = 0; j>= 1;}}}

void TFTLCD::drawChar(uint16_t x, uint16_t y, char c,uint16_t color, uint8_t size) {uint16_t t = x;x=y;y=t;for (uint8_t i =0; i<5; i++ ) {uint8_t line = pgm_read_byte(font+(c*5)+i);for (uint8_t j = 0; j>= 1;}}}

void TFTLCD::drawChar(uint16_t x, uint16_t y, char c,uint16_t color, uint8_t size) {uint16_t t = x;x=y;y=t;for (uint8_t i =0; i<5; i++ ) {uint8_t line = pgm_read_byte(font+(c*5)+i);for (uint8_t j = 0; j>= 1;}}}

I hope it is clear, and hope itll be useful for some of you. Now it works ne for me, this library is really perfect!For the touchscreen library, i still dont get itThanks in advance for your future reply, Justin! (and maybe another person?)

// draw a charactervoid TFTLCD::drawChar(uint16_t x, uint16_t y, char c,uint16_t color, uint8_t size) {for (uint8_t i =0; i<5; i++ ) {uint8_t line = pgm_read_byte(font+(c*5)+i);for (uint8_t j = 0; j>= 1;}}}

// draw a charactervoid TFTLCD::drawChar(uint16_t x, uint16_t y, char c,uint16_t color, uint8_t size) {for (uint8_t i =0; i<5; i++ ) {uint8_t line = pgm_read_byte(font+(c*5)+i);for (uint8_t j = 0; j>= 1;}}}

Thanks for this library.I too got some of the cheap LCD screens marked with http://www.mcufriend.com, and I too get reversed text.But further tests, such as the included tftpaint show that the Y coordinates are reversed.Further investigation shows that on my devices the direction of the Y coordinates is reversed to that expected by the library.So, its not sucient to just alter drawText as described above, but to make some similar changes to the low-level drawing routines.I have made appropriate changes to the library to suit my device, in a modular way so it will now support devices with and without X and/or Y coordinate ipping. Note:this is not the same issue as the orientation feature added by Pierre. I have also included the TouchScreen code used by the examples.All the included examples now compile and run correctly out of the box.http://www.airspayce.com/mikem/TFTLCD-mikem.zip Steven February 13, 2014

Thanks man, I just got this lcd yesterday and tried to make this work for few hours :D, but unfortunately when it started to work the image was mirrored. But theTouchScreen les are corrupted, the program wont compile when they are in the library folder, theres no problem after removing them so maaaaany thanks :).

hey! i have downloaded justins as well as mikes code. in justins code there is a pin LCD_CD dened on the pin A2, but theres no such pin on the LCD, where does it goexactly? can someone please help me ASAP? i am using the exact shield that justin has put up on the blog.

Hi, I have got this screens today 2 of them, but after loading test sketch, screen just blink and does not do anything else. Im running it on Arduino Mega with modiedTFTLCD.cpp from this topic: http://misc.ws/2014/06/26/touch-screen-on-the-arduino-mega-2560/, what could be wrong? Ken Wagnitz February 27, 2014

Thanks to Justin and Mike.I got here from the APC article, after buying a few of the screens to try.Mine look like the one in Justins photo, but exhibited the mirror-imaged text in the graphics test sketch.Mikes library xed that. Now to try touchscreen and SD slot

No luck getting touch input to work. Your sketch comments say to use a multimeter to read the X+ to X- resistance. But you dont say where to measure. The exiblestrip going away from the screen has its insulated side on the outside. I presume the pins going to the Arduino arent analog voltages in? Anyway, I guess poorcalibration would only mean wrong screen position reported, I dont see any response, either on the screen or on the serial monitor. Incidentally I had to set font[] to aconst in glcdfont.c to compile. (Using Mikes library.)Should the screen drop in brightness when running your KeypadTest sketch? Resetting briey brings it up to full brightness. -Or is that an indication I have a pinmismatch with your code?Could be that I have brummy screens. (I have 3.)

The notes in the other sketch about measuring with the multimeter are not mine, Im afraid. Those were in the sketch originally, and I didnt remove them. It looks likeyou should measure between the pins mentioned in the touch screen set-up denes. So, in the example below, I would measure between the A2 pin (X-, LCD_RS) anddigital pin 6 (X+, LCD_D6). I just did so on my board, and it read 326 ohms.

I just updated my download to include the patched version of the library that provides for coordinate ipping. Please update your library and change the denes asneeded to see if it helps. I updated the post with instructions as well.

I have a new arduino mega. I try to make the LCD to work but with no luck. The LCD remaining white. I test it on an arduino uno and work like a charm. Could anyonehelp me??

//codeuint16_t identier = tft.readRegister(0x0);if (identier == 0x9325) {Serial.println(Found ILI9325);} else if (identier == 0x9328) {Serial.println(Found ILI9328);} else {Serial.print(Unknown driver chip );Serial.println(identier, HEX);while (1);}

Hi Guys.Ive searched for the entire web, and found this site. Unfortunaly My board didnt work with any of your tips. In my last hope, I post my problem in the Arduino google+page and, in minutes, I received a tip about this site:http://www.smokeandwires.co.nz/blog/a-2-4-tft-touchscreen-shield-for-arduino/A voil, the board worked like a charm.I hope this tip help more people like me.

Thanks Julio Ferreira for the Smoke and Wires link, this is the only implementation that gave me any results. It worked awlessly whereas all others failed miserably. Myquest for a cheap LCD (from ebay and was the blue mcufriend.com 2.8 inch touchscreen) has nally come to a close.

Hi, First of all let me tell you that I nd your website very informative.I purchased some of these screens a while ago, and I just nally realized I couldnt use the library from Adafruit and started trying to nd the info like crazy.I found your block and while I got it working, using everyones corrections I still do get the screen Y axis inverted.I have corrected the .cpp le that supposedly alters the ipping, with no success. My question is, once I modify the .cpp le, do I save, close and re-upload theprogram to the arduino? or is there something else involved? since its a .cpp le on its own I couldnt re-compile it

maybe you can help me? i have the same display. and i dont get it work correctly. have you ever got it working on a mega2560? thats what i tried to do. my results sofar:1. the touchscreendemo from adafruit fold the following message on the serial monitor :unknown driver chip: 7783. you said you have got C0505 is that correct?that would be 50437 in decimal?2. i got the paint-example working, but without any touch-functionality, so there is just the static picture of the color-elds and the black drawing area.3. in the touchscreendemo i am able to see some x- and y-coordinates, when i press the shield. i am not sure about these coordinates: the x-coordinate shows alwaysthe same value, regardless of the place where i press. she y- and z- values are changing.

thanks to the Clean up pin modes for LCD part*pinMode(XM, OUTPUT);digitalWrite(XM, LOW);pinMode(YP, OUTPUT);digitalWrite(YP, HIGH);pinMode(YM, OUTPUT);digitalWrite(YM, LOW);pinMode(XP, OUTPUT);digitalWrite(XP, HIGH);*

i tried your library in your source code but still i donot see any thing on the screen display only the white backlight . i tried a lot ,plz i really need this working .i solved the errors i got while compililing but it doesnt work .if u can help me in just getting any stu over this screen .plz tell me what i am doing wrong . i am usingmega board

Hi Justin.Excellent article . With all that I found on the net, there was work to do this display.I have only one doubt the tftpaint.ino sketch gives me this error.

tftpaint.ino: In function void loop ():tftpaint: 95: error: Point was not Declared In this scopetftpaint: 95: error: expected `; before ptftpaint: 106: error: p was not Declared In this scope

I am an Engineering student.I want to do project using arduino board.my questions are1)Can an arduino tft touch screen allows to save or store the images.?2)if yes then in which formate it saves.can it be in .jpg or . gif.?3)what is maximum size of arduino tft touch screen.4)is it stores images from sd card.can we send the images from sd card to other devices using bluetooth.

C:\Program Files\Arduino\libraries\TFTLCD\TFTLCD.cpp:761:4: error: #error No pins dened!C:\Program Files\Arduino\libraries\TFTLCD\TFTLCD.cpp:799:4: error: #error No pins dened!C:\Program Files\Arduino\libraries\TFTLCD\TFTLCD.cpp:832:4: error: #error No pins dened!

C:\Program Files\Arduino\libraries\TFTLCD\TFTLCD.cpp:743:4: error: #error No pins dened!C:\Program Files\Arduino\libraries\TFTLCD\TFTLCD.cpp:761:4: error: #error No pins dened!C:\Program Files\Arduino\libraries\TFTLCD\TFTLCD.cpp:799:4: error: #error No pins dened!C:\Program Files\Arduino\libraries\TFTLCD\TFTLCD.cpp:832:4: error: #error No pins dened!

Albert September 4, 2014For the people who do not get it done, download: https://github.com/Smoke-And-Wires/TFT-Shield-Example-Code https://github.com/adafruit/Touch-Screen-Library https://github.com/adafruit/Adafruit-GFX-Library

For the people who do have an arduino Mega 2560 DONT forget to modify the SWTFT.cpp.Change// Use the include which corresponde to your arduino//#include mega_24_shield.h//#include uno_24_shield.h

1) SD card wont work as Uno does SPI via the Digital pins whereas Leonardo has separate pins specically for SPI.2) I need to change the references that map the various pins of the shield to things like PORTB, PORTD etc as the Leonardo port mappings dier from the UNO.

I got a 2.8In one of these from Amazon, all it says in it is www.mcuriend.com and 2.8 TFT LCD ShieldIt came with a mini cd.So far i think i have tried everyones code in the world and all it will do is light up all white????I see in the serial out the line LCD driver Chip: 0 which makes me somewhat suspicious, im pretty sure that should not have a value of zero!Ive checked the pin assignments in the swift code & all looks okay. still it just lights up blank white.Am i missing a massive elephant here or are both of the tft#s i bought du???Any and all help appreciated, im not trying to be lasy here & use someone elses code, I just want to verify i havent been shipped two du screens!

Hi,I bought 2.4 TFT. Plugged it into Arduino MEGA, included mega_24_shield.h and after uploading code what I can see its just full screen of color dots. Chip id is 0. Is itfaulty TFT board or something else? Thanks.

Richard December 7, 2014I also bought this lcd on ebay like Ramis and have the same problem with white screen. The ebay reseller has linked his item to this page for usage instructions butdoesnt provide support because of the low price.

I downolad code, i had an arduino YUN but when i build sample graphicstest i recive error:Arduino\libraries\TFTLCD\TFTLCD.cpp:743:4: error: #error No pins dened!Arduino\libraries\TFTLCD\TFTLCD.cpp:761:4: error: #error No pins dened!Arduino\libraries\TFTLCD\TFTLCD.cpp:799:4: error: #error No pins dened!Arduino\libraries\TFTLCD\TFTLCD.cpp:832:4: error: #error No pins dened!

The Leonardo and Yun have dierent SPI pinouts to the UNO, so youll not be able to connect the shield directly to your arduino and youll need to use jumpers orsomething else to connect the display to your arduinos. I know the Leonardo does NOT duplicate the SPI pins like the UNO, Nano, others, on the Leonardo they are onlyconnected to the 6 pin ISCP (on Uno the 4 of these pins are that make up SPI are also routed through pins 10-13). So these would need to be re-routed with jumpers.(The Mega has dierent pinouts to the Uno of course too, but obviously these are being accounted for the in the code and examples.)Good Luck

could you PLEASE post the exact sketch you used to do ANYTHING with this sceen, nding the UTFT library to operate it took about 3 hours and Im getting corruptresults, NOBODY who has these screens working has posted the initialization line they are using.mine is myGLCD(UNO_24,A2,A1,A3,A4);what are you using!?

Just posting to say that I am also having issues with this screen. The shield looks very similar but it has the phone type icons as someone else has described. It hasmcufriend on the screen though that is not useful. The button is in a slightly dierent place to yours (where the bare solder pads are on yours).

I am able to compile the graphictest ne but when running, the screen just ickers, nothing is displayed. I am worried I damaged something as the bottom of the boardis not protected and the contact there touched the USB shield (something people need to be aware and careful of). Note that it does not icker when the program isnot running so that at least something appears to be happening.

I guess I will grab the adafruit library and see if that does anything. Just getting some kind of output would be good.Thanks for the good work you have done.

Have the same excaty problem. This is the only version of any library that does anything on the screen and its not much, just some ickering. I also tried to play withseveral dierent touchscreen libraries but cant get anything sensible out of them. Even the pressure value is jumping between -297 and 0.My TFT has http://www.mcufriend.com label on the bottom.

if(identier == 0x9325) {Serial.println(F(Found ILI9325 LCD driver));} else if(identier == 0x9328) {Serial.println(F(Found ILI9328 LCD driver));} else if(identier == 0x7575) {Serial.println(F(Found HX8347G LCD driver));} else if(identier == 0x9341) {Serial.println(F(Found ILI9341 LCD driver));} else {Serial.print(F(Unknown LCD driver chip: ));Serial.println(identier, HEX);return;}

It turns out that the device seems to require some time between tft.reset() and tft.readID(). when I put a delay(500) between these calls everything started to work.

Can i interface both Ethernet W5100 R3 and above LCD TFT touch display shields simultaneously with UNO R3. I also need 2 or 3 analog and 2 digital IOs for interfacingthermocouples and sounders .Please advise whether UNO R3 can be used for same or not.

I cannot get my LCD to work! At rst it would always be white, but now I found this and it seemed reliable. I tried it but the one I tried (tftpaint) had an error:tftpaint.ino: In function void loop():tftpaint:94: error: Point was not declared in this scopetftpaint:94: error: expected `; before ptftpaint:105: error: p was not declared in this scope

I did managed to get mine 2.8 tft LCD working with adafruit library, just forcing it to recognize my chipset 8357, despite Im using Arduino MEGA (connecting digitalpins to 22-29) and more its mirrored, but at least working. Now question is : how to make it to work with original pins (2-9) is it possible? What needs to be changed inadafruit library les to remap digital pins?

Thank you all! Very helpful in getting my TFT to work. Now I am facing problem with variables. How can I display variables in tft.print(). I am digging in the library lebut unable to gure out yet. Quick response is highly appreciated!. Aamer January 18, 2015

I am using the same tft, have used dierent libraries of utft and adafruit. For me each of the library compiles and uploads just right. Even in serial monitor everythingjust works ne. The chip in serial monitor that i get is 154 in HEX. But the screen just lights up and stays blank. None of the example like paint and graphics test are notworking. I am using UNO board with this tft. Also i have replaced the tft and UNO boards,but the problem stays as same. I really need to get this working. Help plzz

// This header le serves two purposes://// 1) Isolate non-portable MCU port- and pin-specic identiers and// operations so the library code itself remains somewhat agnostic// (PORTs and pin numbers are always referenced through macros).//// 2) GCC doesnt always respect the inline keyword, so this is a// ham-sted manner of forcing the issue to minimize function calls.// This sometimes makes the library a bit bigger than before, but fast++.// However, because theyre macros, we need to be SUPER CAREFUL about// parameters for example, write8(x) may expand to multiple PORT

// When using the TFT shield, control and data pins exist in set physical// locations, but the ports and bitmasks corresponding to each vary among// boards. A separate set of pin denitions is given for each supported// board type.// When using the TFT breakout board, control pins are congurable but// the data pins are still xed making every data pin congurable// would be much too slow. The data pin layouts are not the same between// the shield and breakout congurations for the latter, pins were// chosen to keep the tutorial wiring manageable more than making optimal// use of ports and bitmasks. So theres a second set of pin denitions// given for each supported board.

// Shield pin usage:// LCD Data Bit : 7 6 5 4 3 2 1 0// Digital pin #: 7 6 13 4 11 10 9 8// Uno port/pin : PD7 PD6 PB5 PD4 PB3 PB2 PB1 PB0// Mega port/pin: PH4 PH3 PB7 PG5 PB5 PB4 PH6 PH5// Leo port/pin : PE6 PD7 PC7 PD4 PB7 PB6 PB5 PB4// Due port/pin : PC23 PC24 PB27 PC26 PD7 PC29 PC21 PC22// Breakout pin usage:// LCD Data Bit : 7 6 5 4 3 2 1 0// Uno dig. pin : 7 6 5 4 3 2 9 8// Uno port/pin : PD7 PD6 PD5 PD4 PD3 PD2 PB1 PB0// Mega dig. pin: 29 28 27 26 25 24 23 22// Mega port/pin: PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0 (one contiguous PORT)// Leo dig. pin : 7 6 5 4 3 2 9 8// Leo port/pin : PE6 PD7 PC6 PD4 PD0 PD1 PB5 PB4// Due dig. pin : 40 39 38 37 36 35 34 33// Due port/pin : PC8 PC7 PC6 PC5 PC4 PC3 PC2 PC1 (one contiguous PORT. -ish)

// LCD control lines:// RD (read), WR (write), CD (command/data), CS (chip select)#dene RD_PORT PORTC/*pin A0 */#dene WR_PORT PORTC/*pin A1 */#dene CD_PORT PORTC/*pin A2 */#dene CS_PORT PORTC/*pin A3 */#dene RD_MASK B00000001#dene WR_MASK B00000010#dene CD_MASK B00000100#dene CS_MASK B00001000

// Write 8-bit value to LCD data lines#dene write8inline(d) { \PORTD = (PORTD & B00101111) | ((d) & B11010000); \PORTB = (PORTB & B11010000) | ((d) & B00101111); \WR_STROBE; } // STROBEs are dened later

// Read 8-bit value from LCD data lines. The signle argument// is a destination variable; this isnt a function and doesnt// return a value in the conventional sense.#dene read8inline(result) { \RD_ACTIVE; \DELAY7; \result = (PIND & B11010000) | (PINB & B00101111); \RD_IDLE; }

// These set the PORT directions as required before the write and read// operations. Because write operations are much more common than reads,// the data-reading functions in the library code set the PORT(s) to// input before a read, and restore them back to the write state before// returning. This avoids having to set it for output inside every// drawing method. The default state has them initialized for writes.#dene setWriteDirInline() { DDRD |= B11010000; DDRB |= B00101111; }#dene setReadDirInline() { DDRD &= ~B11010000; DDRB &= ~B00101111; }

// All of the functions are inlined on the Arduino Mega. When using the// breakout board, the macro versions arent appreciably larger than the// function equivalents, and theyre super simple and fast. When using// the shield, the macros become pretty complicatedbut this board has// so much code space, the macros are used anyway. If you need to free// up program space, some macros can be removed, at a minor cost in speed.#dene write8 write8inline#dene read8 read8inline#dene setWriteDir setWriteDirInline#dene setReadDir setReadDirInline#dene writeRegister8 writeRegister8inline#dene writeRegister16 writeRegister16inline#dene writeRegisterPair writeRegisterPairInline

#dene setReadDirInline() { \pmc_enable_periph_clk( ID_PIOC ) ; \PIOC->PIO_PUDR |= 0x000001FE; PIOC->PIO_IFDR |= 0x000001FE; PIOC->PIO_ODR |= 0x000001FE; PIOC->PIO_PER |= 0x000001FE; }// When using the TFT breakout board, control pins are congurable.#dene RD_ACTIVErdPort->PIO_CODR |= rdPinSet//PIO_Clear(rdPort, rdPinSet)#dene RD_IDLErdPort->PIO_SODR |= rdPinSet//PIO_Set(rdPort, rdPinSet)#dene WR_ACTIVEwrPort->PIO_CODR |= wrPinSet//PIO_Clear(wrPort, wrPinSet)#dene WR_IDLEwrPort->PIO_SODR |= wrPinSet//PIO_Set(wrPort, wrPinSet)#dene CD_COMMANDcdPort->PIO_CODR |= cdPinSet//PIO_Clear(cdPort, cdPinSet)#dene CD_DATAcdPort->PIO_SODR |= cdPinSet//PIO_Set(cdPort, cdPinSet)#dene CS_ACTIVEcsPort->PIO_CODR |= csPinSet//PIO_Clear(csPort, csPinSet)#dene CS_IDLEcsPort->PIO_SODR |= csPinSet//PIO_Set(csPort, csPinSet)

// When using the TFT breakout board, control pins are congurable.#dene RD_ACTIVE *rdPort &= rdPinUnset#dene RD_IDLE *rdPort |= rdPinSet#dene WR_ACTIVE *wrPort &= wrPinUnset#dene WR_IDLE *wrPort |= wrPinSet#dene CD_COMMAND *cdPort &= cdPinUnset#dene CD_DATA *cdPort |= cdPinSet#dene CS_ACTIVE *csPort &= csPinUnset#dene CS_IDLE *csPort |= csPinSet

// Set value of TFT register: 16-bit address, 16-bit value// See notes at top about macro expansion, hence hi & lo temp vars#dene writeRegister16inline(a, d) { \uint8_t hi, lo; \hi = (a) >> 8; lo = (a); CD_COMMAND; write8(hi); write8(lo); \hi = (d) >> 8; lo = (d); CD_DATA ; write8(hi); write8(lo); }

// Set value of 2 TFT registers: Two 8-bit addresses (hi & lo), 16-bit value#dene writeRegisterPairInline(aH, aL, d) { \uint8_t hi = (d) >> 8, lo = (d); \CD_COMMAND; write8(aH); CD_DATA; write8(hi); \CD_COMMAND; write8(aL); CD_DATA; write8(lo); }

Thanxs alott dear for giving us the library for 154 the lcd is now working perfectly accept the touchscreen,the example tft paint is still not working as the there is noresponse from the touchscreen..

@Farrukh, you probably need to take the tftpaint (without shield), and change the pins for the touchscreen to the shield pinout.Because while this looks like a shield to me, for the screen I had to leave the USE_ADAFRUIT_SHIELD_PINOUT commented out, but apparently the touchscreen doeshave the shield pinning.So in the tftpaint sketch, change:#dene YP A3 // must be an analog pin, use An notation!#dene XM A2 // must be an analog pin, use An notation!#dene YM 9 // can be a digital pin#dene XP 8 // can be a digital pin

to:// These are the pins for the shield!#dene YP A1 // must be an analog pin, use An notation!#dene XM A2 // must be an analog pin, use An notation!#dene YM 7 // can be a digital pin#dene XP 6 // can be a digital pinThat worked for me.Also I had to change the display height in Adafruit_TFTLCD.cppfrom:#dene TFTHEIGHT 400to:#dene TFTHEIGHT 320

Just saw on github that the rst = false; line in tftbmp should not be removed, but that the bracketing in the pushColors function in Adafruit_TFTLCD.cpp was wrong.The bracket on line 899 (after CS_IDLE) should in fact be placed on line 889 (before CD_DATA).

Hii use this shield to display numbes the came from sensori try to make the touch screen button in order to turn on and o ledwhen i insert the touch screen command TSPoint p = ts.getPoint(); ,the numbers stop to update on the screen,how can i keep the numbers update and still make button from the screen? Sru February 19, 2015

Hi,I too used this LCD tft to display the data from the sensor..used the library fromhttps://github.com/Smoke-And-Wires/TFT-Shield-Example-Code/tree/master/SWTFT-ShieldI am getting the right values displayed but in mirrored form.Used the same library to display a string and its displayed properly. Is it nythng to do with thetft.setRotation function? without using this function i m not getting the sensor values displayed but if used its giving mirrored values. someone lease help meregarding this.

I am Nagesh and newbie in Arduino. I found this post useful to show info on TFT display. The library is working with UNO where as the same is failing with Arduno Yun.Program complies but there is blank display. I couldnt gure out cause and solution for the same.

I found Andrea, Leonardo Kusch and Manoj Vora faced the same problem above and L Mitchell recommended to use SPI. To be honest I am not able to understand onHOW TO part. I request you to share the connection diagram and sample program (if any). Unfortunately there is very less documentation on this TFT display (bymcufriend.com), so your comments would be helpful.

I think valid share, I had the same problem with mirror image, through brute strength and patience, I was changing dword and succeeded, UTFT \ tft_drivers \spfd5408a \ initlcd.h change in the Control Panel value LCD_Write_COM_DATA (0x90, 0x0010); to the value LCD_Write_COM_DATA (0x90, 0x0033); and be happy varun April 6, 2015

C:\Users\vermillionr\Documents\Arduino\libraries\TFTLCD\glcdfont.c:9:23: error: variable font must be const in order to be put into read-only section by means of__attribute__((progmem))static unsigned char font[] PROGMEM = {^Error compiling.Does anyone know why this error is occurring?

Hi, Could you elaborate where you popped the constant at? in glcdfont.c or in the examples them self?Much thanks Gunner May 22, 2015

After much trial and error, I opened glcdfont.c (in the TFTLCD library) with NOTEPAD (or use any text editor) and popped the word const in front of the only existingword char that I could nd In the rst line of code the rest looked like hex.

I really appreciate this article.As you know most OEM resellers and eBay sellers supply shields generally and including these LCD shields with absolutely no documentation, so the info youveprovided is invaluable. Thank you.

I have adapted the LCD_ID_Reader code to work on an STM32L152RE. I am using Atollic trueSTUDIO. The lcd has MCU Friend printed on it and the controller isST7781 according to the Ebay seller. The ID seems to be C505.

I tried your graphicstest example where I replaced the #include TFTLCD.h by #include and changed the type of font[] to const to be able to compile (Arduino IDE). Istill have a simple white screen.

what a wonderfull website!I had a problem with a e-bay 2.4 inch display, which is equipted with a ili9335 contorller.At rst it will not run on your TFTLCD driver downloaded at your website.It appears only full-white-screen.With x times trial I had found that errors happen to, when the registers are inintialized.Datatransfort may be need more time, so I insert a delay time.

2.4 tft lcd shield library quotation

Let"s get started with this creative Arduino project, where you"ll learn about the TFT LCD touch screen and how to use it to create your own colourful calculator. For a basic understanding of touch screen & LCD, a cheap TFT 2.4" Arduino shield is used to create this project. For creating a similar project, one should follow the steps and edit the code for better understanding.

The shield connects ILI9341"s data pins 0-7 to Arduino"s digital pins 2-8 (allowing parallel communication, not SPI. ILI9341"s RESET goes to Arduino analog pin A4. CS (chip select) to A3. RS (CD command/data) to A2. WR and RD to A1 and A0.

ILI9341 is integrated inside the display. It drives the display and has nothing to do with the touchscreen (Although the shield connects some pins of ILI9341 together with pins of the touchscreen).

To install this library, you can simply click on the link above which will take you to a Github page. There click on clone or download and select “Download ZIP”. A zip file will be downloaded.

Now, open Arduino IDE and select Sketch -> Include Library -> Add .ZIP library. A browser window will open navigate to the ZIP file and click “OK”. You should notice “Library added to your Libraries” on the bottom-left corner of Arduino, if successful.

You can also find an SD card slot at the bottom of the module shown above, which can be used to load an SD card with BMP image files, and these images can be displayed on our TFT LCD screen using the Arduino Program.

The 2.4” TFT LCD screen is a perfect Arduino Shield. You can directly push the LCD screen on top of the Arduino Uno and it will perfectly match with the pins and slid in through. However, as matters of safety cover the programming terminal of your Arduino UNO with some insulator, just in case if the terminal comes in contact with your TFT LCD screen.

2.4 tft lcd shield library quotation

The2.4 inch TFT LCD Shield Touch Screen Module For 2.4 inch TFT LCD display screenhas excellent vivid colour contrast. This Arduino Uno TFT display is big (2.4″ diagonal) bright (4 white-LED backlights) and colourful (18-bit 262,000 different shades). 240×320 pixels with individual pixel control.

As with all Arduino Shields, connecting to the Arduino is simply a matter of plugging the shield in. Take care to align the pins correctly, and ensure the bottom of the shield does not make contact with the Arduino USB port.

1 Adafruit have disabled old model LCD"s support so please install Adafruit_GFX older version 1.5.3 from Sketch--> Include Libraries --> Manage Libraries.

2.4 tft lcd shield library quotation

The 2.4 inch TFT LCD Touch Display Shield for Arduino Uno is fully assembled, tested and ready to go. Add the touch display without wiring, no soldering! Simply plug it in and load up a library – you ‘ll have it running in under 10 minutes! Works best with any classic Arduino ATMEGA328 Board

So spice up your Arduino UNO project with a beautiful large touchscreen display shield with a built-in microSD card connection. This TFT display is big (2.4″ diagonal) bright (4 white-LED backlights) and colorful (18-bit 262,000 different shades)!

2.4 tft lcd shield library quotation

In this tutorial, you will learn how to use and set up 2.4″ Touch LCD Shield for Arduino. First, you’ll see some general information about this shield. And after learning how to set the shield up, you’ll see 3 practical projects.

The role of screens in electronic projects is very important. Screens can be of very simple types such as 7 Segment or character LCDs or more advanced models like OLEDs and TFT LCDs.

One of the most important features of this LCD is including a touch panel. If you are about to use the LCD, you need to know the coordinates of the point you touch. To do so, you should upload the following code on your Arduino board and open the serial monitor. Then touch your desired location and write the coordinates displayed on the serial monitor. You can use this coordination in any other project.

To display pictures on this LCD you should save the picture in 24bit BMP colored format and size of 240*320. Then move them to SD card and put the SD card in the LCD shield. we use the following function to display pictures. This function has 3 arguments; the first one stands for the pictures name, and the second and third arguments are for length and width coordinates of the top left corner of the picture.

2.4 tft lcd shield library quotation

This 240x320 resolution LCD TFT is a standard display with 8-bit/16-bit Parallel interface, offering 262K colors and a 6:00 optimal view. This Liquid Crystal Display has a built-in ST7789Vi controller, FFC ZIF I/O connection, is RoHS compliant and does not come with a touchscreen.

2.4 tft lcd shield library quotation

The 2.4 Inch TFT LCD Touch Screen LCD Display Module for Arduino is a beautiful large touchscreen display shield with built in microSD card connection. The LCD has excellent vivid color contrast. This TFT display is big (2.4″ diagonal) bright (4 white-LED backlight) and colorful (18-bit 262,000 different shades). It has 240×320 pixels with individual pixel control which is way more resolution than a black and white 128×64 display. As a bonus, this display has a resistive touchscreen attached to it already, so you can detect finger presses anywhere on the screen.