This PlatformIO project turns your M5StickC finger computer into a laser rangefinder to precisely measure distances up to 2 meters. For this it needs the ToF HAT (Time-of-Flight) attached to the M5StickC.
Besides displaying the measured distance, the software can also stream the current range value to other devices via Bluetooth LE (BLE). This way, the M5StickC with the ToF HAT can figure as a single point LiDAR to detect obstacles when mounted e.g. on a robot.
To simplify the development of the software, this project uses the synchronous programming language Blech. Blech helps both with structuring your application in a component oriented way and with handling concurrency and timing tasks prevalent in embedded software. It is also very useful to model and control the UI at an abstract level.
Comments