sainsmart tft lcd display for arduino 7 free sample

This is SainSmart MEGA2560  + 7 inch TFT LCD module with the TFT LCD shield kit For arduino enthusiasts.It includes one pcs of SainSmart MEGA2560 , 7 inch TFT LCD display and a TFT LCD shield for Arduino MEGA2560.This kit helps you to avoid complicated wiring processes and save you much time to accomplish your goal. You can feel free to enjoy the touch function and SD card function by using our codes.We will provided you the whole document including the example project of the kit. We will supply you the technical support after your purchase.

This is the new MEGA2560 R3. In addition to all the features of the previous board, the MEGA now uses an ATMega16U2 instead of the ATMega8U2 chip. This allows for faster transfer rates and more memory. No drivers needed for Linux or Mac (inf file for Windows is needed and included in the Arduino IDE), and the ability to have the Uno show up as a keyboard, mouse, joystick, etc.

The MEGA2560 R3 also adds SDA and SCL pins next to the AREF. In addition, there are two new pins placed near the RESET pin. One is the IOREF that allow the shields to adapt to the voltage provided from the board. The other is a not connected and is reserved for future purposes. The MEGA2560 R3 works with all existing shields but can adapt to new shields which use these additional pins.

It is 100% compatible with the normal MCU like ARM AVR PIC and 8051,especially on Arduino family such as Arduino Due and Arduino MEGA2560(R3). The module uses the LCD controller Chip SSD1963 with 7 inch LCD including the touchscreen.

LCD-specificed intialization code is provided, so that you can save time to optimize power control register and gamma curves for best display performance. We have test the provided code, it gives the best display performanace

This is Sainsmart TFT LCD Extend shield for arduino due .Using this shield can help you out of the bothers to use other cables. You just need to plug the module to arduino due through this shield.

The shield defines that all the the data transmit ports are PC1-PC8 and PC12-PC19,the controll pins are PD0-PD3.The perfect design could realize that the data transmits in high speed.The SPI interface is designed in the ISP header of arduino due so that the SPI transfer with DMA could be achieved in high speed with no drag.

This shiled is just for Arduno MEGA2560. If you need the LCD Extend shield for Arduino Due,you need a similar shield which is also provided from our store.

This shiled is just for 7 inch TFT LCD.If you need the LCD Extend shield for 3.2/3.5/...,you need a similar shield which is also provided from our store.

sainsmart tft lcd display for arduino 7 free sample

It is 100% compatible with the normal MCU like ARM AVR PIC and 8051,especially on Arduino family such as Arduino Due and Arduino MEGA2560(R3).The module uses the LCD controller Chip SSD1963 with 7 inch LCD including the touchscreen.

LCD-specificed intialization code is provided, so that you can save time to optimize power control register and gamma curves for best display performance. We have test the provided code, it gives the best display performanace

sainsmart tft lcd display for arduino 7 free sample

This is SainSmart 7 inch TFT LCD module with the TFT LCD shield kit For arduino enthusiasts. It includes one pcs of 7 inch TFT LCD display and a TFT LCD shield for Arduino Due.We will provided you the whole document including the example project of Arduino Due with the kit. We will supply you the technical support after your purchase.

It is 100% compatible with the normal MCU like ARM AVR PIC and 8051, especially on Arduino family such as Arduino Due and Arduino MEGA2560(R3).The module uses the LCD controller Chip SSD1963 with 5 inch LCD including the touchscreen.

LCD-specificed intialization code is provided, so that you can save time to optimize power control register and gamma curves for best display performance. We have test the provided code, it gives the best display performanace

This is SainSmart TFT LCD Extend shield for Arduino Due .Using this shield can help you out of the bothers to use other cables. You just need to plug the module to Arduino Due through this shield.

The shield defines that all the the data transmit ports are PC1-PC8 and PC12-PC19,the controll pins are PD0-PD3.The perfect design could realize that the data transmits in high speed. The SPI interface is designed in the ISP header of arduino due so that the SPI transfer with DMA could be achieved in high speed with no drag.

This shiled is just for Arduno Due. If you need the LCD Extend shield for Arduino MEGA2560(R3), you need a similar shield which is also provided from our webstore.

This shiled is just for 7 inch TFT LCD.If you need the LCD Extend shield for 3.2"" or 5"", you need a similar shield which is also provided from our store.

sainsmart tft lcd display for arduino 7 free sample

This is SainSmart 5 inch TFT LCD module with the TFT LCD shield kit for arduino enthusiasts.It includes one piece of 5 inch TFT LCD display and a TFT LCD shield for arduino due.We will provided you the whole document including the example project of arduino due with the kit. We will supply you the technical support after your purchase.

The SainSmart Due is a microcontroller board based on the Atmel SAM3X8E ARM Cortex-M3 CPU (Datasheet). It is the first Arduino board based on a 32-bit ARM core microcontroller. It has 54 digital input/output pins (of which 12 can be used as PWM outputs), 12 analog inputs, 4 UARTs (hardware serial ports), a 84 MHz clock, an USB OTG capable connection, 2 DAC (digital to analog), 2 TWI, a power jack, an SPI header, a JTAG header, a reset button and an erase button.

LCD-specified initialization code is provided, so that you can save time to optimize power control register and gamma curves for best display performance. We have test the provided code, it gives the best display performanace

It is 100% compatible with the normal MCU like ARM AVR PIC and 8051,especially on arduino family such as arduino due and arduino mega2560(R3).The module uses the LCD controller Chip SSD1963 with 5 inch LCD including the touchscreen.

The shield defines that all the the data transmit ports are PC1-PC8 and PC12-PC19,the controll pins are PD0-PD3.The perfect design could realize that the data transmits in high speed.The SPI interface is designed in the ISP header of arduino due so that the SPI transfer with DMA could be achieved in high speed with no drag.

sainsmart tft lcd display for arduino 7 free sample

This is SainSmart 7 inch TFT LCD module with the TFT LCD shield kit For arduino enthusiasts. It includes one pcs of 7 inch TFT LCD display and a TFT LCD shield for Arduino MEGA2560(R3). We will provided you the whole document including the example project of Arduino MEGA2560(R3) with the kit. We will supply you the technical support after your purchase.

It is 100% compatible with the normal MCU like ARM AVR PIC and 8051, especially on Arduino family such as Arduino Due and Arduino MEGA2560(R3).The module uses the LCD controller Chip SSD1963 with 5 inch LCD including the touchscreen.

LCD-specificed intialization code is provided, so that you can save time to optimize power control register and gamma curves for best display performance. We have test the provided code, it gives the best display performanace

This is SainSmart TFT LCD Extend shield for Arduino MEGA2560(R3). Using this shield can help you out of the bothers to use other cables. You just need to plug the module to Arduino MEGA2560(R3) through this shield.

The shield defines that all the the data transmit ports are PC1-PC8 and PC12-PC19,the controll pins are PD0-PD3.The perfect design could realize that the data transmits in high speed. The SPI interface is designed in the ISP header of arduino due so that the SPI transfer with DMA could be achieved in high speed with no drag.

This shiled is just for Arduno MEGA2560(R3). If you need the LCD Extend shield for Arduino Due, you need a similar shield which is also provided from our webstore.

This shiled is just for 7 inch TFT LCD.If you need the LCD Extend shield for 3.2"" or 5"", you need a similar shield which is also provided from our store.

sainsmart tft lcd display for arduino 7 free sample

This is SainSmart MEGA2560  + 7 inch TFT LCD module with the TFT LCD shield kit For arduino enthusiasts.It includes one pcs of SainSmart MEGA2560 , 7 inch TFT LCD display and a TFT LCD shield for Arduino MEGA2560.This kit helps you to avoid complicated wiring processes and save you much time to accomplish your goal. You can feel free to enjoy the touch function and SD card function by using our codes.We will provided you the whole document including the example project of the kit. We will supply you the technical support after your purchase.

It is 100% compatible with the normal MCU like ARM AVR PIC and 8051,especially on Arduino family such as Arduino Due and Arduino MEGA2560(R3). The module uses the LCD controller Chip SSD1963 with 7 inch LCD including the touchscreen.

LCD-specificed intialization code is provided, so that you can save time to optimize power control register and gamma curves for best display performance. We have test the provided code, it gives the best display performanace

This is Sainsmart TFT LCD Extend shield for arduino due .Using this shield can help you out of the bothers to use other cables. You just need to plug the module to arduino due through this shield.

The shield defines that all the the data transmit ports are PC1-PC8 and PC12-PC19,the controll pins are PD0-PD3.The perfect design could realize that the data transmits in high speed.The SPI interface is designed in the ISP header of arduino due so that the SPI transfer with DMA could be achieved in high speed with no drag.

This shiled is just for Arduno MEGA2560. If you need the LCD Extend shield for Arduino Due,you need a similar shield which is also provided from our store.

This shiled is just for 7 inch TFT LCD.If you need the LCD Extend shield for 3.2/3.5/...,you need a similar shield which is also provided from our store.

sainsmart tft lcd display for arduino 7 free sample

This is Sainsmart Due + 7 inch TFT LCD module with the TFT LCD shield kit For arduino enthusiasts.It includes one pcs of Sainsmart Due , 7 inch TFT LCD display and a TFT LCD shield for arduino due.This kit helps you to avoid complicated wiring processes and save you much time to accomplish your goal. You can feel free to enjoy the touch function and SD card function by using our codes.We will provided you the whole document including the example project of the kit. We will supply you the technical support after your purchase.

The SainSmart Due is a microcontroller board based on the Atmel SAM3X8E ARM Cortex-M3 CPU (Datasheet). It is the first Arduino board based on a 32-bit ARM core microcontroller. It has 54 digital input/output pins (of which 12 can be used as PWM outputs), 12 analog inputs, 4 UARTs (hardware serial ports), a 84 MHz clock, an USB OTG capable connection, 2 DAC (digital to analog), 2 TWI, a power jack, an SPI header, a JTAG header, a reset button and an erase button.

It is 100% compatible with the normal MCU like ARM AVR PIC and 8051,especially on arduino family such as arduino due and arduino mega2560(R3).The module uses the LCD controller Chip SSD1963 with 5 inch LCD including the touchscreen.

LCD-specificed intialization code is provided, so that you can save time to optimize power control register and gamma curves for best display performance. We have test the provided code, it gives the best display performanace

This is Sainsmart TFT LCD Extend shield for arduino due .Using this shield can help you out of the bothers to use other cables. You just need to plug the module to arduino due through this shield.

The shield defines that all the the data transmit ports are PC1-PC8 and PC12-PC19,the controll pins are PD0-PD3.The perfect design could realize that the data transmits in high speed.The SPI interface is designed in the ISP header of arduino due so that the SPI transfer with DMA could be achieved in high speed with no drag.

This shiled is just for arduno due.If you need the LCD Extend shield for arduino mega2560(R3),you need a similar shield which is also provided from our store.

This shiled is just for 7 inch TFT LCD.If you need the LCD Extend shield for 3.2/3.5/...,you need a similar shield which is also provided from our store.

sainsmart tft lcd display for arduino 7 free sample

It is 100% compatible with the normal MCU like ARM AVR PIC and 8051,especially on Arduino family such as Arduino Due and Arduino MEGA2560(R3).The module uses the LCD controller Chip SSD1963 with 7 inch LCD including the touchscreen.

LCD-specificed intialization code is provided, so that you can save time to optimize power control register and gamma curves for best display performance. We have test the provided code, it gives the best display performanace

This shiled is just for 7 inch TFT LCD.If you need the LCD Extend shield for 3.2"" or 5"", you may foudn a similar shield which is also provided from our store.

sainsmart tft lcd display for arduino 7 free sample

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.

For this tutorial I composed three examples. The first example is distance measurement using ultrasonic sensor. The output from the sensor, or the distance is printed on the screen and using the touch screen we can select the units, either centimeters or inches.

The next example is controlling an RGB LED using these three RGB sliders. For example if we start to slide the blue slider, the LED will light up in blue and increase the light as we would go to the maximum value. So the sliders can move from 0 to 255 and with their combination we can set any color to the RGB LED,  but just keep in mind that the LED cannot represent the colors that much accurate.

The third example is a game. Actually it’s a replica of the popular Flappy Bird game for smartphones. We can play the game using the push button or even using the touch screen itself.

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.

As the code is a bit longer and for better understanding I will post the source code of the program in sections with description for each section. And at the end of this article I will post the complete source 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.

Next we need to define the fonts that are coming with the libraries and also define some variables needed for the program. In the setup section we need to initiate the screen and the touch, define the pin modes for the connected sensor, the led and the button, and initially call the drawHomeSreen() custom function, which will draw the home screen of the program.

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.

Next is the distance sensor button. First we need to set the color and then using the fillRoundRect() function we will draw the rounded rectangle. Then we will set the color back to white and using the drawRoundRect() function we will draw another rounded rectangle on top of the previous one, but this one will be without a fill so the overall appearance of the button looks like it has a frame. On top of the button we will print the text using the big font and the same background color as the fill of the button. The same procedure goes for the two other buttons.

Now we need to make the buttons functional so that when we press them they would send us to the appropriate example. In the setup section we set the character ‘0’ to the currentPage variable, which will indicate that we are at the home screen. So if that’s true, and if we press on the screen this if statement would become true and using these lines here we will get the X and Y coordinates where the screen has been pressed. If that’s the area that covers the first button we will call the drawDistanceSensor() custom function which will activate the distance sensor example. Also we will set the character ‘1’ to the variable currentPage which will indicate that we are at the first example. The drawFrame() custom function is used for highlighting the button when it’s pressed. The same procedure goes for the two other buttons.

So the drawDistanceSensor() custom function needs to be called only once when the button is pressed in order to draw all the graphics of this example in similar way as we described for the home screen. However, the getDistance() custom function needs to be called repeatedly in order to print the latest results of the distance measured by the sensor.

Here’s that function which uses the ultrasonic sensor to calculate the distance and print the values with SevenSegNum font in green color, either in centimeters or inches. If you need more details how the ultrasonic sensor works you can check my particular tutorialfor that. Back in the loop section we can see what happens when we press the select unit buttons as well as the back button.

Ok next is the RGB LED Control example. If we press the second button, the drawLedControl() custom function will be called only once for drawing the graphic of that example and the setLedColor() custom function will be repeatedly called. In this function we use the touch screen to set the values of the 3 sliders from 0 to 255. With the if statements we confine the area of each slider and get the X value of the slider. So the values of the X coordinate of each slider are from 38 to 310 pixels and we need to map these values into values from 0 to 255 which will be used as a PWM signal for lighting up the LED. If you need more details how the RGB LED works you can check my particular tutorialfor that. The rest of the code in this custom function is for drawing the sliders. Back in the loop section we only have the back button which also turns off the LED when pressed.

In order the code to work and compile you will have to include an addition “.c” file in the same directory with the Arduino sketch. This file is for the third game example and it’s a bitmap of the bird. For more details how this part of the code work  you can check my particular tutorial. Here you can download that file:

sainsmart tft lcd display for arduino 7 free sample

The display is driven by a ST7735R controller ( ST7735R-specifications.pdf (2.1 MB) ), can be used in a “slow” and a “fast” write mode, and is 3.3V/5V compatible.

Adafruit_ST7735 is the library we need to pair with the graphics library for hardware specific functions of the ST7735 TFT Display/SD-Card controller.

In the file dialog select the downloaded ZIP file and your library will be installed automatically. This will automatically install the library for you (requires Arduino 1.0.5 or newer). Restarting your Arduino software is recommended as it will make the examples visible in the examples menu.

The easiest way to remedy this is by extracting the GitHub ZIP file. Place the files in a directory with the proper library name (Adafruit_GFX, Adafruit_ST7735 or SD) and zip the folder (Adafruit_GFX, Adafruit_ST7735.zip, SD.zip). Now the Arduino software can read and install the library automatically for you.

Basically, besides the obvious backlight, we tell the controller first what we are talking to with the CS pins. CS(TFT) selects data to be for the Display, and CS(SD) to set data for the SD-Card. Data is written to the selected device through SDA (display) or MOSI (SD-Card). Data is read from the SD-Card through MISO.

So when using both display and SD-Card, and utilizing the Adafruit libraries with a SainSmart display, you will need to connect SDA to MOSI, and SCL to SCLK.

As mentioned before, the display has a SLOW and a FAST mode, each serving it’s own purpose. Do some experiments with both speeds to determine which one works for your application. Of course, the need of particular Arduino pins plays a role in this decision as well …

Note: Adafruit displays can have different colored tabs on the transparent label on your display. You might need to adapt your code if your display shows a little odd shift. I noticed that my SainSmart display (gree tab) behaves best with the code for the black tab – try them out to see which one works best for yours.

Low Speed display is about 1/5 of the speed of High Speed display, which makes it only suitable for particular purposes, but at least the SPI pins of the Arduino are available.

After connecting the display in Low Speed configuration, you can load the first example from the Arduino Software (“File” “Example” “Adafruit_ST7735” –  recommend starting with the “graphictest“).

Below the code parts for a LOW SPEED display (pay attention to the highlighted lines) – keep in mind that the names of the pins in the code are based on the Adafruit display:

#define sclk 4 // SainSmart: SCL#define mosi 5 // SainSmart: SDA#define cs 6 // SainSmart: CS#define dc 7 // SainSmart: RS/DC#define rst 8 // SainSmart: RES

#define sclk 13 // SainSmart: SCL#define mosi 11 // SainSmart: SDA#define cs 10 // SainSmart: CS#define dc 9 // SainSmart: RS/DC#define rst 8 // SainSmart: RES

The SD-Card needs to be FAT-16 or FAT-32 formatted, single partition, and the BMP file needs to be placed in the root (ie. not in a directory or anything like that).

You can name your BMP file “parrot.bmp” or modify the Sketch to have the proper filename (in “spitftbitmap” line 70, and in “soft_spitftbitmap” line 74).

#define SD_CS 4 // Chip select line for SD card#define TFT_CS 10 // Chip select line for TFT display#define TFT_DC 9 // Data/command line for TFT#define TFT_RST 8 // Reset line for TFT (or connect to +5V)

#define SD_CS 4 // Chip select line for SD card#define TFT_CS 10 // Chip select line for TFT display#define TFT_DC 9 // Data/command line for TFT#define TFT_RST 8 // Reset line for TFT (or connect to +5V)

As you have seen before the Adafruit_GFX library (supported by the Adafruit_ST7735 library) makes this easy for us – More information can be found at the GFX Reference page.

To use this in your Arduino Sketch: The first 2 characters represent RED, the second set of two characters is for GREEN and the last 2 characters represent BLUE. Add ‘0x’ in front of each of these hex values when using them (‘0x’ designates a hexadecimal value).

This function is used to indicate what corner of your display is considered (0,0), which in essence rotates the coordinate system 0, 90, 180 or 270 degrees.

However, if your application needs your screen sideways, then you’d want to rotate the screen 90 degrees, effectively changing the display from a 128×160 pixel (WxH) screen to a 160×128 pixel display. Valid values are: 0 (0 degrees), 1 (90 degrees), 2 (180 degrees) and 3 (270 degrees).

Based on these functions, I did create a little demo to show what these functions do. Either download the file or just copy the code and paste it into an empty Arduino Sketch.

tft.print("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ");