File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*
22 Name: button.ino
3- Created: 2018/9/21 14:06:15
3+ Created: 2018/9/21 14:06:15
44 Author: sakabin
55*/
66
77#include < M5Stack.h>
88// The setup() function runs once each time the micro-controller starts
99void setup () {
10- // init lcd, serial, not init sd card
10+ // init lcd, serial, but don't init sd card
1111 M5.begin (true , false , true );
1212 M5.Lcd .clear (BLACK);
1313 M5.Lcd .setTextColor (YELLOW);
1414 M5.Lcd .setTextSize (2 );
1515 M5.Lcd .setCursor (65 , 10 );
1616 M5.Lcd .println (" Button example" );
1717 M5.Lcd .setCursor (3 , 35 );
18- M5.Lcd .println (" Press button B 700ms clear" );
18+ M5.Lcd .println (" Press button B for 700ms" );
19+ M5.Lcd .println (" to clear screen." );
1920 M5.Lcd .setTextColor (RED);
2021}
2122
2223// Add the main program code into the continuous loop() function
2324void loop () {
2425 M5.update ();
2526
26- // if want use Releasefor; suggest use Release in press event
27+ // if you want to use Releasefor("was released for"), use .wasReleasefor(int time) below
2728 if (M5.BtnA .wasReleased ()) {
2829 M5.Lcd .print (' A' );
2930 } else if (M5.BtnB .wasReleased ()) {
You can’t perform that action at this time.
0 commit comments