-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.cpp
More file actions
53 lines (47 loc) · 960 Bytes
/
Copy pathsample.cpp
File metadata and controls
53 lines (47 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/****************************************************************
*
* This Example is used to test leds
*
* Arduino tools Setting
* -board : M5StickC
* -Upload Speed: 115200 / 750000 / 1500000
*
****************************************************************/
#include "M5Atom.h"
void setup()
{
M5.begin(true, false, true);
delay(50);
M5.dis.drawpix(0, 0xf00000);
}
uint8_t FSM = 0;
void loop()
{
if (M5.Btn.wasPressed())
{
switch (FSM)
{
case 0:
M5.dis.drawpix(0, 0xf00000);
break;
case 1:
M5.dis.drawpix(0, 0x00f000);
break;
case 2:
M5.dis.drawpix(0, 0x0000f0);
break;
case 3:
M5.dis.drawpix(0, 0x707070);
break;
default:
break;
}
FSM++;
if (FSM >= 4)
{
FSM = 0;
}
}
delay(50);
M5.update();
}