Skip to content

Instantly share code, notes, and snippets.

@TakuroFukamizu
Created April 4, 2020 06:43
Show Gist options
  • Save TakuroFukamizu/09ae9c7aa67dcf3aa2203670505621df to your computer and use it in GitHub Desktop.
Save TakuroFukamizu/09ae9c7aa67dcf3aa2203670505621df to your computer and use it in GitHub Desktop.
M5Atom infinity circle indicator
#include "M5Atom.h"
uint8_t counter = 0;
uint8_t line_circle[] = {2,3,9,14,19,23,22,21,15,10,5,1}; // 12
uint8_t line_seq_limit = 12;
uint8_t line_seq_row_limit = 12;
uint8_t line_seq[12][12] = {
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0},
{1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
};
// ----------------
void display_progress_circle_infinite() {\
if (line_seq_limit < counter) {
counter = 0;
}
int i = counter;
M5.dis.clear();
for (int j=0; j<line_seq_row_limit; j++) {
if (line_seq[i][j] == 1) {
M5.dis.drawpix(line_circle[j], 0x0a00f0);
}
}
counter++;
}
// ----------------
void setup() {
M5.begin(true, false, true);
delay(50);
M5.dis.clear();
}
void loop() {
M5.update();
display_progress_circle_infinite();
delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment