Step 4: Using it

Picture of Using it
The coding is pretty simple. I integrated the whole thing using the excellent LEDcontrol library in Arduino, and it worked off the shelf.

You need to look at my "ledSetup" command to allocate the right pins to the MAX7221, and I also made things better by limiting the scanregister to 4.

Take a look at my pin mapping functions in "BarGraph" I can do dots, and bars. A bit more work, probably with the mapping function and you could do some really neat animations.

The source includes a digital filter called an "exponential forgetter" or first order low-pass filter. Its designed around binary math as far as possible, for high speed operation using shifts and not explicit multiply operations.

The input (0.1024) digits is scaled to 0..30 digits currently: there's no reason not to scale it 0.99 for the 7 segs, and scale it 0..30 for the bar.

I've got several little projects lined up, a VU meter is pretty obvious - the next gen board'll squeeze in two rows of bar, probably only 20 bits per row !

Design requests.

A couple of folks have asked about adding OBD-II interfaces to the thing. I am looking at suitable interfaces for it at the moment - there are three different standard interfaces !!

What I WILL be doing on my next boards is two rows of 20 bars + 4 digits, 2 on each line. Optionally, you can have just 30 bars on each line.

Here's a (future) list of other projects running on the same hardware. If you've got a project you've done using it, let me know in the comments and I'll add a link here:

  • VU meter, coming soon
  • Reaction timer
  • Bath thermometer
  • Kitchen timer
  • TDS/EC meter
  • Moisture meter
  • Vacuum/Boost Gauge (gage !)  by skullmaster20
Jeffrey G C4 years ago
i cant get it to download, ive tried to save it, but it wont let me save it as anything other than .tmp
Save it and rename it.
neutron75 years ago
Hi i am trying to download your code, i want to have a look at how you use a bargraph and 7 segment separately on max 7221 (im doing 7 seg + LED indicators) it points to a temp file.
Save the file as a .pde file and open in Arduino.