-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ASCII and string support for 7-segment backpack #41
Conversation
Why u no merge this ? This awesome |
No functional change, conforming with clang CI test.
I'm not sure what the CI is complaining about here. The array is defined in the source file and I don't see anything of note on line 161. |
just a bump to try and kick the CI to run again
@dmadison Hey, if you're still interested in working this PR, looks like the CI is failing on the doxygen part: |
After some more sleuthing it looks like Doxygen is getting confused with the On the Doxygen side this can be fixed by enabling macro expansion and adding
Unfortunately I'm not sure there's a good way around the issue without modifying the Doxyfile in some way. |
Ugh. What a weird doxy issue. I tried some stuff locally, and just relocating the static const PROGMEM uint8_t sevensegfonttable[] = {
static const PROGMEM uint16_t alphafonttable[] = { |
Attempting to fix a bug with Doxygen. No functional change (hopefully).
Hopefully that works! I've never seen the attribute placed before the variable, but it seems to compile fine on my machine. |
Now clang is unhappy. Looks like just some trailing whitespace. Here's how to install and run: |
When the local clang disagrees with the CI clang... ah automation
Matching the function name in the alphanumeric backpack class
bbb214b
to
b010313
Compare
For matching function signatures between the 7 digit and alphanumeric displays
Are the numeric base changes for |
Ah okay I see it - the removal of the bases for the |
Looks good. Gonna merge. Thanks for continuing to work this update! Tested with: #include "Adafruit_LEDBackpack.h"
Adafruit_7segment seg = Adafruit_7segment();
int count = 0;
void setup() {
seg.begin(0x70);
for (uint8_t i='!'; i<='z'; i++) {
seg.writeDigitAscii(0, i);
seg.writeDigitAscii(1, i+1);
seg.writeDigitAscii(3, i+2);
seg.writeDigitAscii(4, i+3);
seg.writeDisplay();
delay(300);
}
seg.print(1000, DEC); seg.writeDisplay(); delay(1000);
seg.print(0xBEEF, HEX); seg.writeDisplay(); delay(1000);
seg.print(12.34); seg.writeDisplay(); delay(1000);
seg.print("7SEG"); seg.writeDisplay(); delay(1000);
for (uint16_t counter = 0; counter < 9999; counter++) {
seg.println(counter);
seg.writeDisplay();
delay(10);
}
seg.print("YEAH");
seg.writeDisplay();
}
void loop() {
} |
This swaps out the 7-segment hex-only table for a full ASCII character set, allowing the user to write alphanumeric characters and symbols in addition to hexadecimal values.
Like the alpha table, the 7-segment ASCII table is stored in flash memory. All digit display calls now pass through the
writeDigitChar
function, with decimal and hex characters in the pre-existingwriteDigitNum
now offset to their character equivalents. I've also added some overloadedprint
andprintln
functions to write characters and strings to the display, left-justified. Behavior of the integer and float functions is unchanged.This shouldn't break any pre-existing code unless it was accessing the
numbertable
array directly instead of through the class, as that has been replaced by the ASCII font table.I've added a string print test to the
sevenseg.ino
example to demonstrate the string feature.