Contents
  1. 1. New screens
  2. 2. The pain
  3. 3. Installation

As I mentioned in the Graphical Main Menu post, Arduino Mega 2560 doesn’t support to use too much memory based images with the UTFT library. In order to solve this problem, one option was to use the UTFT_SdRaw library to load the required images from the SD card. I promised that I will give it a try! I did! It was painful, but finally it works!

New screens

Now DiveIno is able to load any number of images from the SD card, which makes a big difference in UI design. First I redesigned the About Screen:

The battery status indicator and the current time continuously get updated.

You might notice a small change on the Main Menu. The edges of the buttons are not rounded:

If you navigate on this screen with the right and left arrow buttons on the IR remote control, only the edges of the buttons get redrawn. The images will stay the same. If these get redrawn every time as well, then the on screen buttons are going to flicker quite a lot. The reason is that image loading from the SD card takes some time, so it would be a good idea to load it only once and then leave it intact during other screen object changes.

The graphical button style design was also used on the Settings screen:

If you click on the calendar icon, it will lead you to the Date & Time Settings screen:

The pain

I mentioned earlier that the transition from the old to the new design was painful. Let me explain why!

Originally I used the traditional Arduino SD library to communicate with the SD card. The problem was that the UTFT_SdRaw library does not compatible with it. It relies on the SdFat library, so if I want to load images from the SD card, I have to switch over from the SD library to the SdFat library. In theory it should be a piece of cake, because SdFat implements all SD library functionality with the same interfaces.

Yes, it does, but only on Arduino Mega 2560! When I tried it out on Arduino Due, it turned out that this support only exists on paper. In reality all SD card related read and write code had to be rewritten to use the SdFat library. It obviously took some time to achieve it.

As a side effect long file names are supported now! :)

Installation

Obviously the image files have to be copied onto the SD card before the latest code gets uploaded to DiveIno. The Images folder of the GitHub source repository contains the required images both in raw and PNG format.

I used free images from Iconfinder for the “new look” design.

Contents
  1. 1. New screens
  2. 2. The pain
  3. 3. Installation