atmega328p arduino spi problems tft display factory

Is there a difference between the NANO and MEGA that would account for ST7735 displays working on NANO and not working on MEGA? I"m using the same pins on both....

The SERCOM on the Zero is limited to 12MHz for SPI. SPI is 8MHz on a Uno. Although the SPI on an AVR is fairly primitive, the Arduino Uno core optimises fairly well.
The LCDWIKI"s basic demo file that doesn"t use any libraries works, but all other files fail to compile for a zero. They compile fine for a UNO, but for a zero, the LCDWIKI_SPI file throws so many errors...
I have not tried LCDWIKI on a Zero. I suspect that it would use the crap Zero core SPI library. It will probably be slower than Adafruit. And definitely inconvenient to use badly-spelled methods.
One thing I noticed is that in all the examples I looked at, the touchscreen and LCD display use different SPI connections. Why? I thought SPI was to be shared MOSI, MISO, SCK, and each device needs a CS pin.

So I have an arduino uno that works great with hope rf95, I tried to take the atmega328p-pu off the arduino and connect it unto a breadboard, I connected a 16mhz crystal+2X22pf capacitors and the mcu works great, however, it wont "speak" with the rf95.

By these two functions, You can find out the resolution of the display. Just add them to the code and put the outputs in a uint16_t variable. Then read it from the Serial port by Serial.println();. First add Serial.begin(9600); in setup().

In this article, you will learn how to use TFT LCDs by Arduino boards. From basic commands to professional designs and technics are all explained here.
In electronic’s projects, creating an interface between user and system is very important. This interface could be created by displaying useful data, a menu, and ease of access. A beautiful design is also very important.
There are several components to achieve this. LEDs, 7-segments, Character and Graphic displays, and full-color TFT LCDs. The right component for your projects depends on the amount of data to be displayed, type of user interaction, and processor capacity.
TFT LCD is a variant of a liquid-crystal display (LCD) that uses thin-film-transistor (TFT) technology to improve image qualities such as addressability and contrast. A TFT LCD is an active matrix LCD, in contrast to passive matrix LCDs or simple, direct-driven LCDs with a few segments.
In Arduino-based projects, the processor frequency is low. So it is not possible to display complex, high definition images and high-speed motions. Therefore, full-color TFT LCDs can only be used to display simple data and commands.
In this article, we have used libraries and advanced technics to display data, charts, menu, etc. with a professional design. This can move your project presentation to a higher level.
In electronic’s projects, creating an interface between user and system is very important. This interface could be created by displaying useful data, a menu, and ease of access. A beautiful design is also very important.
There are several components to achieve this. LEDs, 7-segments, Character and Graphic displays, and full-color TFT LCDs. The right component for your projects depends on the amount of data to be displayed, type of user interaction, and processor capacity.
TFT LCD is a variant of a liquid-crystal display (LCD) that uses thin-film-transistor (TFT) technology to improve image qualities such as addressability and contrast. A TFT LCD is an active matrix LCD, in contrast to passive matrix LCDs or simple, direct-driven LCDs with a few segments.
In Arduino-based projects, the processor frequency is low. So it is not possible to display complex, high definition images and high-speed motions. Therefore, full-color TFT LCDs can only be used to display simple data and commands.
In this article, we have used libraries and advanced technics to display data, charts, menu, etc. with a professional design. This can move your project presentation to a higher level.
Size of displays affects your project parameters. Bigger Display is not always better. if you want to display high-resolution images and signs, you should choose a big size display with higher resolution. But it decreases the speed of your processing, needs more space and also needs more current to run.
After choosing the right display, It’s time to choose the right controller. If you want to display characters, tests, numbers and static images and the speed of display is not important, the Atmega328 Arduino boards (such as Arduino UNO) are a proper choice. If the size of your code is big, The UNO board may not be enough. You can use Arduino Mega2560 instead. And if you want to show high resolution images and motions with high speed, you should use the ARM core Arduino boards such as Arduino DUE.
In electronics/computer hardware a display driver is usually a semiconductor integrated circuit (but may alternatively comprise a state machine made of discrete logic and other components) which provides an interface function between a microprocessor, microcontroller, ASIC or general-purpose peripheral interface and a particular type of display device, e.g. LCD, LED, OLED, ePaper, CRT, Vacuum fluorescent or Nixie.
The display driver will typically accept commands and data using an industry-standard general-purpose serial or parallel interface, such as TTL, CMOS, RS232, SPI, I2C, etc. and generate signals with suitable voltage, current, timing and demultiplexing to make the display show the desired text or image.
The LCDs manufacturers use different drivers in their products. Some of them are more popular and some of them are very unknown. To run your display easily, you should use Arduino LCDs libraries and add them to your code. Otherwise running the display may be very difficult. There are many free libraries you can find on the internet but the important point about the libraries is their compatibility with the LCD’s driver. The driver of your LCD must be known by your library. In this article, we use the Adafruit GFX library and MCUFRIEND KBV library and example codes. You can download them from the following links.
You must add the library and then upload the code. If it is the first time you run an Arduino board, don’t worry. Just follow these steps:Go to www.arduino.cc/en/Main/Software and download the software of your OS. Install the IDE software as instructed.
By these two functions, You can find out the resolution of the display. Just add them to the code and put the outputs in a uint16_t variable. Then read it from the Serial port by Serial.println(); . First add Serial.begin(9600); in setup().
First you should convert your image to hex code. Download the software from the following link. if you don’t want to change the settings of the software, you must invert the color of the image and make the image horizontally mirrored and rotate it 90 degrees counterclockwise. Now add it to the software and convert it. Open the exported file and copy the hex code to Arduino IDE. x and y are locations of the image. sx and sy are sizes of image. you can change the color of the image in the last input.
Upload your image and download the converted file that the UTFT libraries can process. Now copy the hex code to Arduino IDE. x and y are locations of the image. sx and sy are size of the image.
In this template, We converted a .jpg image to .c file and added to the code, wrote a string and used the fade code to display. Then we used scroll code to move the screen left. Download the .h file and add it to the folder of the Arduino sketch.
In this template, We used sin(); and cos(); functions to draw Arcs with our desired thickness and displayed number by text printing function. Then we converted an image to hex code and added them to the code and displayed the image by bitmap function. Then we used draw lines function to change the style of the image. Download the .h file and add it to the folder of the Arduino sketch.
In this template, We created a function which accepts numbers as input and displays them as a pie chart. We just use draw arc and filled circle functions.
In this template, We added a converted image to code and then used two black and white arcs to create the pointer of volumes. Download the .h file and add it to the folder of the Arduino sketch.
In this template, We added a converted image and use the arc and print function to create this gauge. Download the .h file and add it to folder of the Arduino sketch.
while (a < b) { Serial.println(a); j = 80 * (sin(PI * a / 2000)); i = 80 * (cos(PI * a / 2000)); j2 = 50 * (sin(PI * a / 2000)); i2 = 50 * (cos(PI * a / 2000)); tft.drawLine(i2 + 235, j2 + 169, i + 235, j + 169, tft.color565(0, 255, 255)); tft.fillRect(200, 153, 75, 33, 0x0000); tft.setTextSize(3); tft.setTextColor(0xffff); if ((a/20)>99)
while (b < a) { j = 80 * (sin(PI * a / 2000)); i = 80 * (cos(PI * a / 2000)); j2 = 50 * (sin(PI * a / 2000)); i2 = 50 * (cos(PI * a / 2000)); tft.drawLine(i2 + 235, j2 + 169, i + 235, j + 169, tft.color565(0, 0, 0)); tft.fillRect(200, 153, 75, 33, 0x0000); tft.setTextSize(3); tft.setTextColor(0xffff); if ((a/20)>99)
In this template, We display simple images one after each other very fast by bitmap function. So you can make your animation by this trick. Download the .h file and add it to folder of the Arduino sketch.
In this template, We just display some images by RGBbitmap and bitmap functions. Just make a code for touchscreen and use this template. Download the .h file and add it to folder of the Arduino sketch.

The Arduino Uno is probably the most popular Arduino board, and for good reason. It’s relatively small, very inexpensive (especially clone boards) and has a wealth of support code and documentation. It’s also likely the first Arduino board you started working with, for some of you it may even be the only Arduino board you own.
You’ll find that the majority of projects and demonstrations that I perform on this website and on the YouTube channel use an Arduino Uno. It’s also my favorite Arduino board.
But the real value of the Arduino Uno is as a development or prototyping board. With an Arduino Uno and a solderless breadboard you can quickly bring ideas and concepts to life, its connectors work well with jumper wires and the wealth of code available for the Arduino platform makes development tasks a breeze.
After you finish you’ll have a working project but it may not be a practical one to use in the real world. It has no enclosure and as it consists of an Arduino Uno, a solderless breadboard and various wires, modules, and components. It’s actually pretty fragile.
One big thing that you’ll need to factor into your decision is the Arduino Uno itself. It may be perfect for your permanent project, but again, it may not be.
The Arduino Uno is a wonderful device. With a generous helping of digital I/O ports, 8 analog-to-digital converters, I2C, Serial and SPI interfaces and onboard voltage regulation it is suitable for powering a wide variety of devices. It has a built-in USB port and onboard LEDs and can provide both 5-volt and 3.3-volt low-current power supplies for your peripheral devices.
The Arduino Nano– This small board can do everything an Arduino Uno can, it even has two additional analog to digital converters. It has a mini USB connector instead of the bulky Type B connector used on the Arduino Uno. Cost wise it’s a bit less expensive.
The ATmega328– This is the solution you’ll be reading about in this article. It’s the microcontroller that powers the Arduino Uno, and it can be used all on its own.
The original Arduino Uno and its clones used the 28-pin DIP (Dual Inline Package) version of the ATmega328. Other clones and boards like the Nano and Pro Mini make use of surface mount versions, this explains why the Nano and Pro Mini have two additional analog to digital converters.
As you can see from the diagram above the ATmega328 has several pins that have two, or even three, functions. You can change the functions of these pins programmatically within your sketch, the same is true of the Arduino Uno (which makes perfect sense as the Uno is based upon the ATmega328).
When converting your design from an Arduino Uno to a raw ATmega328 chip it is helpful to be able to relate the pinouts on the ATmega328 to the connections on an Arduino Uno. The following pinout diagram has been relabeled to show the Arduino Uno equivalent functions:
An example might be helpful to help you equate the pins on an Arduino to those on an ATmega328. For that reason, I’ve put together a very simple project that can be quickly prototyped on an Arduino Uno. We will then look at what is required to move our simple project to an ATmega328.
After building this you’ll realize that using an entire Arduino Uno is a real overkill, as only three digital I/O pins are put to use. It also would lend itself well to being mounted into a Star Wars toy or a custom 3D-printed enclosure.
I took the easy road and used an excellent sketch that has been on GitHub for over 6 years. It is theArduino Song sketch by Nick Sort, you can take a look at it here:
If you look closely an an Arduino Uno board you’ll notice that aside from the ATmega328 there really are not very many components. Most of the “extra” parts have to do with either the USB to serial interface or with the internal 5-volt and 3.3-volt regulators.
In actual fact, you can put together a functional equivalent of an Arduino Uno using only an ATmega328 and five parts. You can even wire on up without any additional parts if you are willing to run it at a lower clock frequency.
A “bootloader” is code that is burned onto the ATmega328 chips EEPROM. This code is loaded when the processor is powered up or reset and it sets up things like the clock frequency and a number of the internal registers. It also gets the ATmega328 ready to accept programs from the Arduino IDE on its serial RX and TX pins.
The Arduino Bootloader is essentially what makes an ATmega328 into an “Arduino”. It is open source code that is already available in your Arduino IDE, and you can use the Arduino IDE to load a bootloader into a blank ATmega328 chip.
You might not need to do this though. You can purchase an ATmega328 with the bootloader already installed. That is what I did for this project. Look for an ATmega328 chip that has the letters “PU” at the end of the part number, i.e. ATmega328P-PU.
If you do need to burn your own bootloader there are many resources that will show you how, including the one on theofficial Arduino website. You can also get dedicated devices that burn bootloaders automatically, useful if you have dozens or hundreds of chips to set up.
Assuming that you have an ATmega328 with a bootloader burned onto it you are now ready to wire it up. You will need a few extra components for your “homemade Arduino”.
You can use an Arduino Uno to load the sketch onto the ATmega328, but only if you have the right kind of Arduino Uno. Let me explain what I mean by “right kind”:
The original Arduino Uno, as well as several clones, use a 28-pin DIP version of the ATmega328. The same type of ATmega328 that we are going to be programming.
This chip was mounted in an IC socket and thus can be removed. And the ability to remove the chip from its socket provides us with two methods of using the Arduino Uno to program an ATmega328 for our stand-alone configuration.
Of course, if your Arduino Uno clone uses a surface mount chip then you’re out of luck. But fear not, there is a third method of programming an ATmega328 that doesn’t require an Arduino Uno at all.
Simply use the Arduino Uno as you normally would and program your sketch onto it. Then carefully remove the ATmega328 from your Arduino Uno and use it on the breadboard, wired as we have seen earlier.
The IC socket on the Arduino Uno is not really made for repeated removals and insertions. Eventually, you will degrade or damage it if you do this a lot.
The second method also requires an Arduino Uno that has a 28-pin DIP version of the ATmega328. As with the first method you’ll need to remove the processor from the Arduino board. Unlike the first method, however, you will just be putting the ATmega328 aside. After we are done you can put it back into the IC socket.
This method will make use of the USB to serial converter that is built into the Arduino Uno. The outputs of this converter are always available on pins 0 and 1 of the Uno’s digital I/O connecter. With this method we will just send those outputs to our ATmega328 on a breadboard.
Again remember,although it isn’t shown in the diagram above you need to have all of the other wiring to the ATMega328 as well. This diagram only shows theadditional connections you need to make using the Arduino Uno!
What you are doing is tying the RX (receive) pin of the Arduino Uno to the RX pin on the ATmega328 (pin2). You are also connecting the TX (transmit) pin on the Uno to the ATmega328 TX pin (pin 3). And, finally, the Reset pin on the Arduino Uno is connected to the Reset pin on pin 1 of the ATmega328.
There seems to be a lot of conflicting advice on the web regarding how you setup the Arduino IDE to program your ATmega328 using this method. Some suggest that you change the board type.
I have not found that to be necessary. I just leave my Arduino IDE set exactly as it was when programming my Arduino Uno normally. And it worked every time.
When you are loading your sketch you should notice that a few of the LEDs on the Arduino Uno wil blink, just like they do normally. It’s a good indication that everything is working properly.
But what do you do if your Arduino clone uses a surface mount chip, or if you just don’t want to pull the chip out of the socket on your board? Let’s look at another method that doesn’t use an Arduino Uno at all.
The FTDI Adapter is a USB to serial convertor that is commonly used to program an Arduino Pro Mini and other microcontrollers that do not have a USB port. The “FTDI” abbreviation comes from the original manufacturers’ name, a Scottish company calledFuture Technology Devices International.
Also, note that unlike the previous method which used the Arduino Uno the FTDI method requires you to reverse transmit and receive. So the RX output from the FTDI adapter connects to the TX pin (pin 3) on the ATmega328 and the TX output from the FTDI adapter is attached to the RX pin (pin 2) on the ATmega328.
Once again I found I didn’t need to make any changes in my Arduino IDE, it just worked as it always did. One thing to note however is that the computer in my workshop is LINUX (Ubuntu 16.04) and if you are using a Windows computer you may need to install a driver to use the FTDI adapter.
This method of programming an ATmega328 has a lot of advantages once you get it working, the primary one being that it is completely independent and does not require you to modify an Arduino Uno.
Learn how to transfer your Arduino Uno projects to an ATmega328 chip so you can create a permanent version in a custom enclosure. Uses a Star Wars music box as an example.

The purpose of this guide is to get your 0.96″ color LCD display successfully operating with your Arduino, so you can move forward and experiment and explore further types of operation with the display. This includes installing the Arduino library, making a succesful board connection and running a demonstration sketch.
Although you can use the display with an Arduino Uno or other boad with an ATmega328-series microcontroller – this isn’t recommended for especially large projects. The library eats up a fair amount of flash memory – around 60% in most cases.
So if you’re running larger projects we recommend using an Arduino Mega or Due-compatible board due to the increased amount of flash memory in their host microcontrollers.
(As the display uses the ST7735S controller IC, you may be tempted to use the default TFT library included with the Arduino IDE – however it isn’t that reliable. Instead, please follow the instructions below).
Please check that the library has been installed – to do this, select the Sketch > Include Libraryoption in the IDE and scroll down the long menu until you see “ER-TFTM0.96-1” as shown below:
The display uses the SPI data bus for communication, and is a 3.3V board. You can use it with an Arduino or other 5V board as the logic is tolerant of higher voltages.
The library used is based on the uTFT library by Henning Karlsen. You can find all the drawing and other commands in the user manual – so download the pdf and enjoy creating interesting displays.

Spice up your Arduino project with a beautiful large touchscreen display shield with built in microSD card connection. This TFT display is big (7" diagonal) bright (14 white-LED backlight) and colorfu 800x480 pixels with individual pixel control. As a bonus, this display has a optional capacitive and resistive touch panel attached on screen 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!
For 7 inch screen,the high current is needed.But the current of arduino uno or arduino mega board is low, an external 5V power supply is needed. Refer to the image shows the external power supply position on shield ER-AS-RA8875.
If you"ve had a lot of Arduino DUEs go through your hands (or if you are just unlucky), chances are you’ve come across at least one that does not start-up properly.The symptom is simple: you power up the Arduino but it doesn’t appear to “boot”. Your code simply doesn"t start running.You might have noticed that resetting the board (by pressing the reset button) causes the board to start-up normally.The fix is simple,here is the solution.

Spice up your Arduino project with a beautiful touchscreen display shield with built in microSD card connection. This TFT display is 2.2" 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 Controller FT6236 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!
If you"ve had a lot of Arduino DUEs go through your hands (or if you are just unlucky), chances are you’ve come across at least one that does not start-up properly.The symptom is simple: you power up the Arduino but it doesn’t appear to “boot”. Your code simply doesn"t start running.You might have noticed that resetting the board (by pressing the reset button) causes the board to start-up normally.The fix is simple,here is the solution.

To the above, I would add: The AVR controllers are pretty expensive, plus I don"t particularly like the idea of shipping controllers with flash memory because they tend to stop working after a while. This is less of a problem with automotive grade chips but it still exists as a potential source problems.
The ATMEGA48/88/168/328 family is a great tool for feeling your way around a new subject, and to a certain extent the Arduino platform would make life a lot easier than learning yet another assembly lanugage but if you really anticipate high volume production you would be best off because of cost and potentially reliability considering an IC designed specifically designed to perform this function. To wit:https://www.nxp.com/products/peripherals-and-logic/lcd-drivers:MC_71118

I2C and SPI ports, as well as additional IO lines from the ESP8266-12E, are available, but things could get messy if we added breakout modules with wires to these ports. It will however still stay limited to the amount of IO ports available on the single ESP8266 chip...
At the same time, while playing around with the APE ( Arduino Port Extender ) protocol that is available for ESPHome, we thought that, since it would be quite easy to modify the existing sketch, and rewrite the C header file that defines the APE custom component, It would actually be a great idea to put an ATMEGA328P onto the add-on card. That way, It would be possible to add quite a lot of additional IO Lines, with some Analogs Inputs as well. It still does not take care of the Relay outputs, but that shall be addressed later...
Another point to consider was the fact that the ATMEGA328P would be running from 5v ( I wanted it to operate at 16Mhz, where it seems that only 8Mhz is possible when running at 3.3v? ). The ESP runs at 3.3v however, so all signals exchanged between the two microcontrollers will need to pass through a level converter.
I decided to add an onboard level converter, and while I was at that, gave it 8 channels so that I could use more than one serial protocol if needed ( SPI as well as I2C ). I also decided that since I was designing anyway, I would address some of the issues that I have with the existing Arduino Nano board, adding a dedicated 3.3v LDO Voltage Regulator, additional power outputs, and a jumper to select the source for the 3.3v input --- In other words, I might have totally overengineered the board :) a common problem in my life :)
I also wanted to experiment with uploading ATMEGA chips through the ISCP interface, something that I have not done in quite a while, since I moved away from PIC microcontrollers, and started using Arduino and ESP32/ESP8266 type chips...
LED indicators for the status of both 5v and 3.3v power lines were also added. The AREF line was not broken out to a header, as I very seldom use that anyway. Apart from that, the GPIO breakout to the headers follows the standard Arduino Nano layout.
USB Serial was not initially part of my plan, but after some thinking on the matter, I decided that it would actually be a good idea to add it. This would enable me to use this PCB as a standalone "Arduino compatible" device as well...
The Logic Level converters perform quite well too. Below is a short video of a test using an ST7789 TFT Display ( SPI ), and an SSD1306 OLED Display ( I2C ) using libraries from Adafruit. The code was uploaded via ISCP using the Cytron Maker Uno and the Arduino IDE ( using Arduino as ISP )

Amateur Radio Single Sideband Transceiver Controller for Arduino and SI5351 Clock generator. Includes Dual VFO, single or double band support for 20 and 40 meter bands, CAT control, optional S-meter, multiple supported displays including options include 20x4 LCD, Color TFT, and 2.8" Nextion Touch Screen

Recently, I had the idea to make a digital picture frame—one of these kinds which load images from SD cards and show each image for some time. I was remembering myself that I already own a small TFT display, the KMR-1.8 SPI, that works out of the box with an Arduino Uno. When I digged up my KMR-1.8 SPI, I realized that it has also an in-built SD card reader. Moreover, I looked up the Internet and found ready-to-use libraries for the in-built SD card reader as well as showing images on the TFT display. For these reasons, I thought making such an digital picture frame will turn out very easy.
When I started to implement my first lines of codes and started to connect my Arduino Uno to the KMR-1.8 SPI, I ran into two major problems. First, the colors of my image file did not match to the colors displayed by the KMR-1.8 (red and blue were interchanged). Second, my first prototypes stopped to work after about 5 minutes. The application started to freeze and showed the same image forever instead of displaying the next image after a chosen time.
I did some research on the Internet and I found out that many people ran into similar problems. The second problem seemed to be caused by some memory leaks in the code. Nevertheless, I did not came across any example code that worked out of the box for my setup. Therefore, I want to share how I made it work.
There exists various versions of so-called “1.8 TFT displays” from different manufacturers. Not all of them are 100% compatible to each other. Therefore, if you own a TFT display and want to use my tutorial to make it work, please check if your TFT display really matches the version I used in this tutorial:
The source code relies on three header files (and libraries): SPI.h (Link), SD.h (Link) and TFT.h (Link). Please make sure that all of them are correctly installed before trying out my source code (In Arduino IDE: Tools -> Manage Libraries…).
In the introduction of this blog post, I mentioned that I came across two major problems: the colors red and blue were interchanged and my early Arduino programs started to freeze after some time. Luckily, I was able to fix all issues. The following source code works perfect on my setup. My “digital picture frame” does not require to be restarted after some time (my long-term test lasted about two weeks—and no restart was necessary).
I overcame the first problem by not using the default initialization method (“TFTscreen.begin();”) of the TFT library. Instead, I looked up whats inside the “begin”-method. I found a method called “initR” which has a parameter that allows to perform the initialization for a specific chip. Here, the parameter value “INITR_BLACKTAB” worked for me as the colors were then shown correctly. In addition, I call the method “setRotation” with parameter value “1” in order to be conform to the default initialization method. In the end, the code for the setting up the TFT library object looks like this:// ...
I solved the second problem (application freezes after some time) by avoiding any possible memory leak, i.e. to “free” every bit of memory that was reserved before as soon as it is not needed anymore. Therefore, you will find a lot of “close”-method calls as well as some weird string handling. When I wrote the code, I thought I could simplify a few things. However, the memory leak problems came back. So, the code might look weird but it works :)
The code looks for image files (*.BMP) on the SD card and shows each image for 60 seconds. You can change the display time by setting “DELAY_IMAGE_SWAP” to a new value.
Ms.Josey
Ms.Josey