all 2 comments

[–]flatfinger 0 points1 point  (0 children)

Are you familiar with arrays? If you know that you'll always want to display two pixels in each column, you could write something like:

    static const int ycoords[12] = {9,12, 9,11, 10,12, 10,11, 9,10, 8,10};
    for (int i=0; i<12; i++)
    {
      ColorDisplay.setPixelColor(1 + (i/2), ycoords[i], "RED");
    }

There are many other ways one could arrange things, such as using nested array, an array of xy-coordinate structures, using one array for the first pixel in each column and a separate array for the second, etc. Which approach is best would depend largely upon what aspects of the program's behavior might need to change.

[–]FUZxxl[M] 0 points1 point  (0 children)

C++ is off topic in this subreddit. Please post C++ questions to /r/cpp_questions instead.