-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AtomS3 Button not defined in M5Unified.h #87
Comments
Hello, @myAlterX . |
Hi! I'm including: #include <M5AtomDisplay.h>
#include <M5Unified.h> then in setup: auto cfg = M5.config();
// external display setting. (Pre-include required)
cfg.external_display.module_display = false; // default=true. use ModuleDisplay
cfg.external_display.atom_display = true; // default=true. use AtomDisplay
cfg.external_display.unit_glass = false; // default=true. use UnitGLASS
cfg.external_display.unit_glass2 = false; // default=true. use UnitGLASS2
cfg.external_display.unit_oled = false; // default=true. use UnitOLED
cfg.external_display.unit_mini_oled = false; // default=true. use UnitMiniOLED
cfg.external_display.unit_lcd = false; // default=true. use UnitLCD
cfg.external_display.unit_rca = false; // default=true. use UnitRCA VideoOutput
cfg.external_display.module_rca = false; // default=true. use ModuleRCA VideoOutput
M5.begin(cfg);
in loop somewhere I test for: if (M5.BtnA.wasPressed() || M5.BtnB.wasPressed() || M5.BtnC.wasPressed() || M5.BtnEXT.wasPressed()) because this doesn't seem to work, I just read the digital pin for now: int val = digitalRead(BTN_PIN);
// Handle button press
if (M5.BtnA.wasPressed() || M5.BtnB.wasPressed() || M5.BtnC.wasPressed() || M5.BtnEXT.wasPressed() || val == LOW) which I have set at the top to 41 thanks to your clever labeling! const int BTN_PIN = GPIO_NUM_41;
I took a peek at the lib and found this comment:
```cpp
/*
/// List of available buttons:
M5Stack BASIC/GRAY/GO/FIRE: BtnA,BtnB,BtnC
M5Stack Core2: BtnA,BtnB,BtnC,BtnPWR
M5Stick C/CPlus: BtnA,BtnB, BtnPWR
M5Stick CoreInk: BtnA,BtnB,BtnC,BtnPWR,BtnEXT
M5Paper: BtnA,BtnB,BtnC
M5Station: BtnA,BtnB,BtnC,BtnPWR
M5Tough: BtnPWR
M5ATOM: BtnA
*/ Which doesn't seem to have any mention of the AtomS3. Don't know if constants are defined. If they are, it doesn't work for me. Thanks for your quick reply! |
Are you using
|
No I was not! M5.update();
if (M5.BtnA.wasPressed()) {
// works
} You may close the issue! |
It seems like I can't use the shortcut button implementation on the Unified lib because Btn or BtnA don't seem to be mapping to the proper GPIO in the AtomS3.
Great little device though!
The text was updated successfully, but these errors were encountered: