Javelin Stamp Project – LED Display

I got my Javelin Stamp microprocessor the other day, and have converted my Basic Stamp 2 project code to Java. The wiring is exactly the same. All I did was pop out the BS2 chip and pop in the Javelin. Well, that and rewrite the code. I decided to create a class to represent the LED as an object. I had a few requirements in mind:

  1. The class had to be reusable for any seven-segment LED display. This requires creating an internal, logical segment map. The physical I/O pin mapping to each logical segment is provided by the user of this reusable class.
  2. The class had to be easy to use. Something like:
      Create an instance of the class
      Provide the physical I/O pin-to-segment mapping in a very simple way
      Call a method and pass it the number (0-9) to be displayed

I thought about submitting my new class as a candidate for consideration as a Javelin library, but it’s really too simple. I don’t figure they’re gonna want it.

So, here’s a picture of the setup:

If you recognize this picture, you win the big prize!

Here’s a link to the source code:


This was fun. Next: writing a Java program to make the Javelin act as a controller for a 12 key matrix encoded keypad.


One Response to “Javelin Stamp Project – LED Display”

  1. […] Pins 1-3 will be sent +5V one at-a-time, and pins 4-7 will be checked to see if there is a voltage. I noticed there was some noise on pins 4-7 even when I made them low, so I put a pull down resistor (1k) on each of those pins. The algorithm is so simple. Of course, I leveraged the code I wrote for the to control what number gets displayed on the LED. Note: I can’t really display an asterisk or a pound sign on a seven segment LED, so those keys result in nothing displayed. […]

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: