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:

SevenSegmentLED

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

One thought on “Javelin Stamp Project – LED Display

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