Created
April 4, 2020 06:43
-
-
Save TakuroFukamizu/09ae9c7aa67dcf3aa2203670505621df to your computer and use it in GitHub Desktop.
M5Atom infinity circle indicator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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