M5StickC ToF Hat UIFlow example missing?
I would like to use the ToF Hat with the M5StickC for distance measurement.
The UIFlow example looks a bit short and there is no link to a piece of code.
UIFlow web has a lot of Hats in the DEMO menu, but this one is missing.
How can I interface the ToF Hat to show the measured distance on the M5StickC display?
Nope, that is all that is needed to show values from tof.
The Get Distance block returns the value from sensor and other blocks handle the data. it is the same for the tof unit.
PG197 is for the unit but its almost identicle.
mb last edited by mb
Thanks for the hint. I forgot to add the ToF Hat in UIFlow with the Hat '+' below the M5StickC.
Now with the simplest program (Setup+Loop), I get an error message when ToF Hat is added:
Traceback (most recent call last): File "flow/m5cloud.py", line 76, in _exec_fun File "<string>", line 8, in <module> File "hat.py", line 49, in get File "<string>", line 1, in <module> File "hats/_tof.py", line 9, in __init__ AttributeError: 'module' object has no attribute 'init'
When I remove the ToF Hat it runs again.
Do I need to install anything? Using UIFlow v1.6.5 (web and firmware)
@mb You haven't added any functions to the loop and so it cant initialise the TOF hat.
Once you add a function block and the get distance block like in the example then the micropython init code will be added.
The pure "Setup-Loop" block is running fine - as long as I do not add the ToF Hat.
Now I have a loop block with functions inside, which works fine.
When adding the ToF Hat (just in the configuration) it breaks, I see a Traceback.
Even with ToF Hat and ToF function it does not work.
Traceback (most recent call last): File "flow/m5cloud.py", line 76, in _exec_fun File "<string>", line 9, in <module> File "hat.py", line 49, in get File "<string>", line 1, in <module> File "hats/_tof.py", line 9, in __init__ AttributeError: 'module' object has no attribute 'init'
I am using UIFlow v1.6.5 (web and firmware).
Has anyone the M5StickC with ToF Hat up and running? And can share the code?
@mb well that is strange
Maybe @m5stack can have a look. Is this a bug with v1.6.5?
@mb this is a bug. we will fix it in the next version
Thanks @m5stack. Will this be hours, days, weeks or months?
Just so I know when I can move my project forward.
@mb already fixed. you could use the new firmware version M5StickC
Awesome @m5stack, thank you!
M5StickC and ToF Hat work great with firmware