-
Notifications
You must be signed in to change notification settings - Fork 0
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
M5 Tough #1
Comments
OK with unifiedButton.update() BEFORE M5.update() it doesn't really work either. Only isPressed() and pressedFor() are working wasClicked() doesn't work. probably because the corresponding variables are reset in M5.update(). |
Hi @GrandeRipper , Thanks for using my library. As you guessed, it seems to be caused by overwriting values on the M5Unified side. When the M5Unified side is updated, I would like to include M5Tough support in this library as well. |
M5Unified develop branch has been updated. Could you try the following configuration? lib_deps=https://github.com/m5stack/M5Unified.git#develop |
Hi @GOB52 , i forgot to thank you for your work and your library. Sorry about that. With the develop version of M5Unified everything works as it should! (with customised UnifiedButton::begin) |
Hi @GrandeRipper . Thanks for trying. _enable = /*M5.getBoard() == m5::board_t::board_M5StackCoreS3 &&*/ M5.Touch.isEnabled(); |
Hi @GOB52 _enable = /*M5.getBoard() == m5::board_t::board_M5StackCoreS3 &&*/ M5.Touch.isEnabled(); |
Thanks for the reply. The next update would be the following code. auto bd = M5.getBoard();
_enable = (bd == m5::board_t::board_M5StackCoreS3 || bd == m5::board_t::board_M5Tough)
&& M5.Touch.isEnabled(); The reason why "M5.Touch.isEnabled()" alone is not enough is that there are devices like Core2 that are touch capable and have touch buttons outside the screen.. I will start after the official update of M5Unified. |
On a side note, it would be great if the buttons could be labelled differently during the execution of the programme. |
As M5Unified has been updated, gob_unifiedButton has also been updated and published 0.1.5. If you have tried it and there are no problems, would you please close the issue? |
Hello,
I would like to use the lib with an M5Tough. For this I had to change line 27 in UnifiedButton::begin(LovyanGFX* gfx, const appearance_t app) function as follows:
_enable = /*M5.getBoard() == m5::board_t::board_M5StackCoreS3 &&*/ M5.Touch.isEnabled();
This displayed the buttons and they changed colour when I clicked on them. However, conditions such as "M5.BtnA.wasHold()" were never true. I found out that this is probably due to line 1207 - 1209 in M5Unified.cpp (version 0.1.14) => M5.update()
The lib works at least if I comment out these lines. An alternative solution seems to be the execution of unifiedButton.update() BEFORE M5.update()
Is there a better way to solve the problem? I am also not clear why running unifiedButton.update() BEFORE M5.update() seems to be a solution.
The text was updated successfully, but these errors were encountered: