Skip to content

v2.0.0

Choose a tag to compare

@TechTronicsEngineering TechTronicsEngineering released this 06 Jun 01:21
· 84 commits to main since this release
4c54f48

Welcome to AutoPlex7 v2.0.0!

This new release features many new features, fixes bugs and pain points, and features a total code rewrite.

Changes

The latest version of our software has made many changes. Some of the most important include:

  • Changing the multiplexing timer from timer2 to timer1 (so that tone() works properly)
  • Letting users name their own display objects, and create multiple of them
  • Adding support for alphanumeric characters using a new print() function
  • Polishing floating point support for ease of use with the new setNumberF() function
  • Easier operation with displays that have varying digit counts. The library will now handle up to 8 digits per display, but can theoretically be modified to support more than two hundred (at the cost of more memory usage)

What AutoPlex7 users should be aware of

In order to maintain the new feature set, we had no choice but to remove the interrupt handler from the source code.
The previous versions of AutoPlex7 integrated this function directly into the library. But now, to support custom display object names or use more than one screen at once, we had to deduct this.
Currently, the multiplexing loop must be integrated into your sketch, above the main code, like this:

#include <AutoPlex7.h>

AutoPlex7 MyDisplay; // Create a display object

ISR(DISPLAY_REFRESH) {
  MyDisplay.multiplex();
  // If you're using more than one display, call multiplex() on all instances
}

void setup() {
}

void loop() {
}

The timer itself is still set up by the display class, and the main loop is completely free to use. Blocking functions will not interfere with the display.

Display setup changes

While older AutoPlex7 versions used global variables to store pinout and display configuration information, the newest release requires parameters to be passed directly to a call to begin().
Assuming a four-digit common cathode display...

Old AutoPlex7 configuration:
#include <AutoPlex7.h>

int displayType = COMMON_ANODE;
int D1 = 1;
int D2 = 2;
int D3 = 3;
int D4 = 4;
int A = 5;
int B = 6;
int C = 7;
int D = 8;
int E = 9;
int F = 10;
int G = 11;
int DP = 12;

void setup() {
  display.begin();
}
New AutoPlex7 configuration
#include <AutoPlex7.h>

AutoPlex7 display;

ISR(DISPLAY_REFRESH) {
  display.multiplex();
}

void setup() {
  bool displayType = COMMON_CATHODE;
  byte displayDigits = 4;
  byte digitPins[] = {1, 2, 3, 4};
  byte segmentPins[] = {5, 6, 7, 8, 9, 10, 11, 12};
  display.begin(displayType, displayDigits, digitPins, segmentPins);
}

This makes integrating a second display seamless.

#include <AutoPlex7.h>

AutoPlex7 display1;
AutoPlex7 display2;

ISR(DISPLAY_REFRESH) {
  display1.multiplex();
  display2.multiplex();
}

void setup() {
  // Assuming display1 is a 4-digit common cathode...
  bool displayType1 = COMMON_CATHODE;
  byte displayDigits1 = 4;
  byte digitPins1[] = {1, 2, 3, 4};
  byte segmentPins1[] = {5, 6, 7, 8, 9, 10, 11, 12};
  display1.begin(displayType1, displayDigits1, digitPins1, segmentPins1);

  // Assuming display2 is a two-digit common anode...
  bool displayType2 = COMMON_ANODE;
  byte displayDigits2 = 2;
  byte digitPins2[] = {13, 14};
  byte segmentPins2[] = {15, 16, 17, 18, 19, 20, 21, 22};
  display2.begin(displayType2, displayDigits2, digitPins2, segmentPins2);
}

For more information on AutoPlex7, refer to the readme.