Your code helped a lot to start using the M5stack Tab5 screen in the Squareline studio environment.
Unfortunately the code as proposed does not allow to use the M5unified library and thus all the nice additional features of the Tab5.
After some investigation, I discovered that it is very simple to unlock the power of M5unified.
In fact rather than using a specific display driver, just use the M5 display driver
Here are the steps to modify your code:
- Add the M5unified library and M5Unified.h in the main .ino code
- Delete the line with "M5GFX display" definition
- replace display with M5.Display wherever it is used
- And add:
M5.config();
M5.begin();
at the beginning of the setup() routine.
This should make the trick.
This way I used the power functions to determine battery voltage, battery state and charge state.
Hope this helps other users with the Tab5 which is a nice piece of material.
Your code helped a lot to start using the M5stack Tab5 screen in the Squareline studio environment.
Unfortunately the code as proposed does not allow to use the M5unified library and thus all the nice additional features of the Tab5.
After some investigation, I discovered that it is very simple to unlock the power of M5unified.
In fact rather than using a specific display driver, just use the M5 display driver
Here are the steps to modify your code:
M5.config();
M5.begin();
at the beginning of the setup() routine.
This should make the trick.
This way I used the power functions to determine battery voltage, battery state and charge state.
Hope this helps other users with the Tab5 which is a nice piece of material.