frameworklabs / ranger

Turns your M5StickC with the ToF HAT into a laser rangefinder.
MIT License
8 stars 2 forks source link

Screen drawing issues #2

Closed xcs011 closed 4 weeks ago

xcs011 commented 4 weeks ago

Project just does this on new m5stick plus with TOF hat image

xcs011 commented 4 weeks ago

I did not know the stick and stick plus were two separate boards, my bad.

frameworklabs commented 4 weeks ago

Hi @xcs011,

thanks for reporting this issue - and also finding the cause of it.

Are you able to fix it on your side? Unfortunately I don’t have the stick plus. Please tell me if I can help you in any way.

Best Marc

xcs011 commented 4 weeks ago

It could possibly be an issue with platformio not having the newer M5stickC boards. I can change the orientation of the screen or the size of the screen sprite, but I cannot change where it actually draws said sprite too, as far as I can tell.

xcs011 commented 4 weeks ago

@frameworklabs I can confirm to the best of my knowledge that the issue lies with the M5StickC library not being compatible with the M5StickCPlus, The same error presents in a small test sketch I wrote as well.

I am currently having compiler issues with the stock M5StickCPlus library, so I am unsure if I can easily solve it.

xcs011 commented 4 weeks ago

Irrelevant to our issue directly, however it is worth noting this is why M5StackCPlus doesn't compile: https://github.com/Bodmer/TFT_eSPI/issues/2628

frameworklabs commented 4 weeks ago

Hi @xcs011,

there is this newer approach with https://github.com/m5stack/M5Unified which tries to harmonize the APIs for the different M5Stack devices.

Unfortunately it was not available when I started this project.

Best, Marc

xcs011 commented 3 weeks ago

Thank you, I patched the M5stickC Plus library to work with the latest esp_idf and esp_core so I will continue working on it today. I will keep you updated.

frameworklabs commented 3 weeks ago

Hi,

sounds like a good start!

I am now on vacation for a week, so I might not be able to follow your progress timely.

Best Marc

xcs011 commented 3 weeks ago

@frameworklabs

I manually added the M5StickC Plus library after fixing it, the project now compiles fine. I had to do some minor tweaking as .GetInputPowerStatus and .setLDO3 are not available on the M5StickC Plus.

setLDO2 still works fine, and the not as great workaround for GetInputPowerStatus is that you can still get the input power voltage, so comparing that against a threshold can relatively accurately tell.

Only thing left would be scaling up the UI elements to fit the new screen, but I do not really have time at the moment.

I can fork and upload my M5StickC Plus code or whatever you think would be best if you want it.

frameworklabs commented 3 weeks ago

Hi @xcs011,

I added you as a collaborator on the project, so you could alternatively also open a PR. But forking is also ok - as you like.

Best Marc