Skip to content
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

For loop in example is wrong #82

Open
DocAlex opened this issue Jan 4, 2024 · 0 comments
Open

For loop in example is wrong #82

DocAlex opened this issue Jan 4, 2024 · 0 comments

Comments

@DocAlex
Copy link

DocAlex commented Jan 4, 2024

The Loop in the example reads like:

// send a message!
for (uint8_t i=0; i<strlen(message)-4; i++) {
alpha4.writeDigitAscii(0, message[i]);
alpha4.writeDigitAscii(1, message[i+1]);
alpha4.writeDigitAscii(2, message[i+2]);
alpha4.writeDigitAscii(3, message[i+3]);
alpha4.writeDisplay();

If you try this with a string length 4 you will discover a wrong display.

This works:

char *message = "4711";

// send a message!
for (uint8_t i=0; i<strlen(message)-3; i++) {
alpha4.writeDigitAscii(0, message[i]);
alpha4.writeDigitAscii(1, message[i+1]);
alpha4.writeDigitAscii(2, message[i+2]);
alpha4.writeDigitAscii(3, message[i+3]);
alpha4.writeDisplay();

A general comment:

The examples are far too complicated. I would suggest to give a simple example just showing a four letter string without rolling, scrolling and the like. These complicated operations are nice to have, but pls start with the basics.

It would be helpful, you could give an example how to display integers on the display.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant