Last week I began playing with individual LEDs, played with shift registers, and wrote a program to display 867-5309 from Tommy Tutone's song "Jenny". A buddy of mine was joking with me and said, "You should have it display the lyrics from a song." I just knew I wasn't going to do that with a numeric LED display.
I had ordered some 1602 LCD displays and so I decided to play with those. Quickly I had lyrics flowing across the LCD showing the lyrics from my buddy's pop song "Friday" by Rebecca Black. I shake my head about some people's musical tastes. It was obvious that a 16x2 LCD display was not conducive to displaying lyrics as 16 or even 32 characters was simply insufficient to get more than a couple words out. So, I thought I would move to a larger display.
However, before I did that, I was on E-14 and I saw vaupell 's post about a simple DIY Oscilloscope using an Arduino Mega and a TFT LCD display. I was inspired and wanted to build one. STILL DO. Along with the 16x2 LCD display, I had ordered a 3.0/3.2 TFT LCD and a couple Arduino Megas. The display that I picked up had no literature with it, no markings, etc. It must be Chinese in origin. The shield used the entire end connector of the Mega, and completely covered all of the other connections to the Mega. As I didn't have the same size TFT display that Martin used, I realized that direct translation of his project was not going to happen, at least not happen easily.
Instead I went searching for a library that would actually allow me to use a 3.0/3.2 TFT LCD display. My search lead me to Mr. Henning Karlsen's Rinky-Dink Electronics page and his UTFT display library.:
After spending some time figuring out what settings I needed to make the universal driver work with my specific display, I was able to get HK's demo up and running on the display. AWESOME! :
https://www.youtube.com/watch?v=dk8QUhe0ueY
I'm gathering supplies to build my own power supply and part of my plans to do that are to include arduino control and measurement of the outputs as well as the use of some type of display for the values. I own a Rigol 832A three channel power supply and I like the layout of that power supply. I found an image for Rigol's DP821 dual channel power supply, and decided to give myself the challenge of making my own power supply look similar to it.
So, I set to it and this is what I came up with:
The included font libraries are somewhat limiting. They have a very small 8x12 pixel font, a 16x16 pixel font, and then they have the larger 32x50 LED DIGIT font. Here's the problem. The large LED digit font is limited to a 10 character set of [0,1,2,3,4,5,6,7,8,9] Notice that there is no decimal place or '-'. If I want to use this to display larger numbers like I have, I'm going to have to figure out how to modify the library's built in fonts or make my own fonts that include a decimal place and a '-' sign. Another option is to just graphically display a decimal place and break all measurements into respective numbers on either side of the decimal place. I was also thinking that it would be pretty easy to have the ability to switch to a second display page that has tracking traces for voltage and current for each of the channels.
I spent a few hours trying to display a bitmap image on the display. Finally gave up on it for awhile as I got frustrated with it. I wanted to display this image as a "Troutware" splash screen on startup of the power supply.
I successfully converted the above image to an array of data for the display, using an online image conversion tool, but still could not get it to work. Ugh! I tried to keep the size of the array down, by keeping the image no larger than about 100 x 100 pixels, but it is still pretty crazy. Here is a small sample of what the array looks like:
// Generated by : ImageConverter 565 Online
// Generated from : troutware.jpg
// Time generated : Sun, 22 Mar 15 04:15:34 +0100 (Server timezone: CET)
// Image Size : 101x101 pixels
// Memory usage : 20402 bytes
#if defined(__AVR__)
#include <avr/pgmspace.h>
#elif defined(__PIC32MX__)
#define PROGMEM
#elif defined(__arm__)
#define PROGMEM
#endif
const unsigned short troutware[10201] PROGMEM={
0xF7BE, 0xF7BE, 0xF79E, 0xEF7D, 0xF79E, 0xF79E, 0xEF7D, 0xF79E, 0xFFDF, 0xE73C, 0xFFDF, 0xF79E, 0xEF5D, 0xF7BE, 0xEF7D, 0xFFDF, // 0x0010 (16) pixels
0xFFFF, 0xFFDF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF79E, 0xFFDF, 0xEF7D, 0xE73C, 0xE71C, 0xDEDB, 0xCE79, 0xCE79, 0xD6BA, 0xD6BA, // 0x0020 (32) pixels
0xE73C, 0xEF7D, 0xFFFF, 0xFFFF, 0xF79E, 0xFFDF, 0xF7BE, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF7BE, 0xEF5D, 0xF79E, 0xF7BE, // 0x0030 (48) pixels
0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, // 0x0040 (64) pixels
0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, // 0x0050 (80) pixels
0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, 0xF79E, // 0x0060 (96) pixels
...
Can anyone provide me with some insight as to what I may be doing wrong? I'm pretty sure that I followed the drawBitmap command format that is laid out in the UTFT manual, but it continues to have problems with the 5th variable in the command when I go to compile the code. That 5th variable is the array variable name. I'd love some guidance as to what I may be doing wrong.
The above image was from the UTFT manual located here: UTFT - Rinky-Dink Electronics
As a last, somewhat funny aside, for those of you that know I am colorblind, while I was designing the power supply display, the coding for it requires the use of RGB colors codes for the foreground, and background colors. I located a pretty ?Japanese? color chart that includes the colors in RGB and Hex. I chuckled to myself when I was designing the power supply display, that if what I think looks nice is actually some hideous shade of purple, you guys are going to have to be gentle in critiquing my fashion sense.