Mixing M5Atom.h and M5StickCPlus.h
-
I have a complex application that has been using M5tickCPlus.h since I was
using the M5. This works nicely.Unfortunately every time there is a new board, such at the M5Atom, the M5 class library
is different. For example M5Atom.h has a M5.dis member for the LED button colors. And
The M5StickCPlus has a M5.BtnB for managing the buttons.So how do others manage larger program complexity when these libraries are at odds with each other?
I basically go back to the M5StickCPlus and in this case cannot use the M5.dis feature.Do I create my own M5 with all the class methods I want? Also the board needs to be changed to include those different include files.
-
Maybe porting your code to M5Unified would make sense then
-
@frameworklabs Interesting I hadn't heard of M5Unified but will look into it. Do you have a pointer to M5Unified? (I'll search)
I did end up grabbing the dis the LED_DisPlay code as is but didn't connect to the M5 class. That seems to work.
I've been using the QRCode Scanner with the ATOM with some success.
thanks.
-
I am sure you found it yourself already but just for reference: https://github.com/m5stack/M5Unified
Cheers
-
The M5United looks impressive. I'll look at migrating if it fits my size constraints.
-
I'm now onto getting the M5Core2 to work with my existing infrastructure. Looking at the M5United, I cannot see how that would be used (as the readme doesn't have a Core2 define).
It sure seems that the M5 code provided by M5Stack and others shouldn't reuse the M5 class name. Instead they should have say M5Core2 instead of M5, and M5Core2Display not M5Display.
Sure it works for the standalone programs, but trying to merge code would need something like
your M5United. Looking under the covers of say M5Core2's M5 class, they include their own Lcd (for example) which isn't compatible with other Lcd's.As I mentioned in the previous post, for the ATOM pulling over the LED was relatively easy. But for the M5Core2 there is a lot of code that overlaps with the M5 base (starting with M5Display).
eg. M5Display.h is defined 3 places (and I use the M5StickCPlus in my main code base).
./libraries/M5Core2/src/M5Display.h
./libraries/M5StickCPlus/src/M5Display.h
./libraries/M5Stack/src/M5Display.hI'll look more at M5United and if you can point to getting their M5DIsplay working that would help.
thanks