A Little Off Code, Computers, Photography and Guns

11May/090

LCD Hello World!

DSC_4108

I finally got impatient with my progress on the LCD Shield I'm designing and decided to solder the headers onto the LCD and give it a try on the breadboard, which has turned out to be a good idea. The original pin-mapping I setup in the design wouldn't have worked and I would have been very frustrated at my wasting ~$20 on getting a PCB printed. I got a lot of great help from http://www.alfonsomartone.itb.it/kwztcq.html which almost problem-for-problem outlined the same order of issues I had excluding problems #2, #4 and #8.

1
2
3
4
5
6
7
8
9
10
11
12
13
#define RS 11
#define RW 2
#define E  3
#define D0 4
#define D1 5
#define D2 6
#define D3 7
#define D4 14
#define D5 15
#define D6 16
#define D7 17

LiquidCrystal lcd(RS,RW,E,D0,D1,D2,D3,D4,D5,D6,D7);

Above is what the pin-mapping ended up being. I also discovered I had no pots to use for the contrast pin on the LCD at all so that's going to have to be fixed in the future. So for the time being the contrast is a little out of whack. But I was able to get it to print the traditional "Hello World!" string as you can see in the photo. Also you'll note that I used pins 14 through 17 and you're probably scratching your head as to which pins those are. They're actually the row of pins marked as analog in, analog in 0 is 14 and can actually be used as a digital IO pin as well.

Something else that I've also noticed that I'll need to fix is that the rows seem to be written to out of order. Writing order is as follows: Row 1, Row 3, Row 2, Row 4. Which I'm sure I can fix somehow but I don't know exactly why it's doing that just yet.

6May/090

I should have looked at the dimensions…

DSC_4095

Over the weekend I ordered a 20x4 character LCD for my arduino... I should have looked a little more closely in the datasheet at the section about it's dimensions. Needless to say it's a bit larger than I had originally pictured. So the LCD Shield I've been designing has been thrown off a little bit by the size of this beast.

Looking at the picture the LCD is on the left and my arduino + battery backpack is on the right. I wasn't really planning on it being that huge, but anyway it looks like I'm going to have to heavily modify the PCB layout I've already done for it.