Skip to content

For loop in example is wrong #82

Description

@DocAlex

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions