Tuesday, October 15, 2013

Raspberry Pi Journal #32

Adafruit LCD w/ Keypad First Test

I finally installed the script to run Adafruit LCD w/ Keypad Kit. Mine is the RGB version, so I get all the colors. It was rather scary trying to enter the unknown. I did it with some trepidation. Obviously, I backed up my system!

Turns out there's no trouble at all.

I'm not running Occidentalis, so I have to do things the hard way, which isn't hard at all. I opened up the file /etc/modules and there's only one entry on it. I simply added these two lines at the end (per instruction)


And that's it. Reboot for it to take effect, and install some programs. Again, this is all mentioned in the helpful instructions.

  • sudo apt-get install python-smbus
  • sudo apt-get install i2c-tools

By the way, I make sure that I don't already have the package. But it's not necessary. The installation will install the latest package version if necessary, but that's about it. Also, i2c-tools install a set of program into /usr/sbin.

Next, I went and installed the source code from github. It turns out that I already have git on my computer. So, all I have to do is clone it from the directory.

  • git clone https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git

And that's it. Very quickly done. Next, install update Python to allow GPIO programming:

  • sudo apt-get install python-dev
  • sudo apt-get install python-rpi.gpio

Thankfully the python demo script auto-detect my device. At first, I wasn't sure that the program is running. Then I remembered that the LCD is contrast sensitive. I pulled out my trusty Swiss Army Knife. Popped out philips screwdriver, and adjusted the contrast. I was elated when I see the lettering, and downright happy when the text and the color changes per button presses!

Oh, yeah! I guess I'm a hardware engineer, now! Well, I guess I should learn Python programming so I can do cool stuff with it!

No comments:

Post a Comment