-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
402f0d1
commit 2fe3b4c
Showing
7 changed files
with
260 additions
and
676 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* @file singlePress.ino | ||
* @author SeanKwok (shaoxiang@m5stack.com) | ||
* @brief M5Cardputer single key test | ||
* @version 0.1 | ||
* @date 2023-10-09 | ||
* | ||
* | ||
* @Hardwares: M5Cardputer | ||
* @Platform Version: Arduino M5Stack Board Manager v2.0.7 | ||
* @Dependent Library: | ||
* M5GFX: https://github.com/m5stack/M5GFX | ||
* M5Unified: https://github.com/m5stack/M5Unified | ||
*/ | ||
|
||
#include "M5Cardputer.h" | ||
|
||
void setup() { | ||
auto cfg = M5.config(); | ||
M5Cardputer.begin(cfg, true); | ||
M5Cardputer.Display.setRotation(1); | ||
M5Cardputer.Display.setTextColor(GREEN); | ||
M5Cardputer.Display.setTextDatum(middle_center); | ||
M5Cardputer.Display.setTextFont(&fonts::FreeSerifBoldItalic18pt7b); | ||
M5Cardputer.Display.setTextSize(1); | ||
M5Cardputer.Display.drawString("Press m Key", | ||
M5Cardputer.Display.width() / 2, | ||
M5Cardputer.Display.height() / 2); | ||
} | ||
|
||
void loop() { | ||
M5Cardputer.update(); | ||
if (M5Cardputer.Keyboard.isChange()) { | ||
if (M5Cardputer.Keyboard.isKeyPressed(KB_KEY_L_M)) { | ||
M5Cardputer.Display.clear(); | ||
M5Cardputer.Display.drawString("m Pressed", | ||
M5Cardputer.Display.width() / 2, | ||
M5Cardputer.Display.height() / 2); | ||
} else { | ||
M5Cardputer.Display.clear(); | ||
M5Cardputer.Display.drawString("Press m Key", | ||
M5Cardputer.Display.width() / 2, | ||
M5Cardputer.Display.height() / 2); | ||
} | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.