This is a companion app built with Vite(Vue) + Tauri, to track the data send by HC-SR04 sensor.
Tauri 🐂, the back-end part, is built inside Vite. You can find all the files in src-tauri
.
src
contain the front-end files. Vite provides support for Vue, React, the usual JS... But the app is in Vue.
It has two modes, a DEMO mode if you don't have a sensor, that spawn random points between 20 and 500, and a LIVE mode when working with your sensor.
Btleplug is inserted into a #[tauri::command]
to receive data.
Sytem dependencies for Tauri are described here.
All the tweaks for the chart can be found in src/components/MyChart.vue,
const options = ref<ChartOptions<'line'>>
and const chartData = computed<ChartData<'line'>>(()
In particular, if you love the look of a Bezier function, change the tension
value:
const chartData = computed<ChartData<'line'>>(() => ({
tension: 0.1,
In a terminal, run the command:
- npm run dev
In another terminal, run:
- npm run tauri dev
This needs to be done in this order!