Arduino and Serial Communication with LCD

To start off on this project, I first made sure that I had my LCD hooked up correctly with the Arduino, so I ran Joel Murphy’s code that he supplied via e-mail. All went ok (I did have to delete a line or two of code in the variable definition area because they were not closed with semicolons).

After that, I found out how many pixels there were per section on the LCD, so I took a look at the Serial LCD documentation off of the Parallax website. Each square is 8 x 5, and there are 32 squares. So I did some sketches of what I wanted to make with my custom character:

I decided to do a sine wave, and I used a conversion table from ASCII.ci to assign codes for my custom character. You can see the conversion table that I used here. In order to do a sine wave, I created 4 custom characters. Here is a photo of my custom characters on the LCD:

For the animation of it, I decided to print through each permutation backwards to give the effect that the sine wave was moving forwards. You can see a video of the animation here:

This entry was posted in 2009 Fall, Physical Computing and tagged , . Bookmark the permalink. Follow any comments here with the RSS feed for this post. Post a comment or leave a trackback: Trackback URL.

6 Comments

  1. amber
    Posted October 24, 2009 at 11:32 pm | Permalink

    hey ryan,

    did u have to change the delay to anything else? There is only one wire going to pin 3 of the Atmega chip(arduino pin 1 ) right ?

  2. Ryan
    Posted October 24, 2009 at 11:43 pm | Permalink

    Amber,
    I didn’t need to mess with the delay. The program that Joel sent has one wire going to Digital Pin 2 (which is the 3rd pin in on the Arduino Board or the 4th pin in if you are using your chip in the Breadboard).

    If you’re not getting anything going from Joel’s code, double check to make sure you have the correct “mode” set on the back of the LCD. There are 4 modes (test, 2400, 9600, and 19200). I used the 9600 setting.

    Good luck!

  3. amber
    Posted October 25, 2009 at 12:09 pm | Permalink

    Thanks Ryan, i found the problem. I was using a 20MHZ crystal. The clocking on my chip was off.

  4. Posted October 28, 2009 at 5:10 pm | Permalink
  5. Posted March 30, 2010 at 11:58 am | Permalink

    Thanks for posting this man, it saved my life :)

  6. Ryan
    Posted March 31, 2010 at 11:26 am | Permalink

    haha. no problem. just checked out your site. pretty sweet. i like the strand competition stuff. hope you win. see you around.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>