RAK2270 Sticker Tracker Acceleration tinyML example but using a cell phone or laptop mouse instead of the LoRa/LoRaWan RAK2270 sticker tracker
Demo at or use the QR code https://hpssjellis.github.io/tinyMLjs/public/acceleration/a00-best-acceleration-rak2270-sticker-tracker.html

Start of TinyMlJs SPA (Single Page Application)

Using your cell phone accelerometer (use QR code above) populate the data and clean it of messy input, change the label to "1sideways" and keep the data

repeat for 3 total moving sideways readings (you would collect much more if this was not a demo)
Then repeat for 3 more moving vertical readings. Change label to "2up"

Then click convert data to tensor and train all. If nothing happens youi can try the "Clean, Trim or Fill All" button to try to tidyup the data. (Sensor data is messy)
Once done, capture new data clean it and classify it.

You can export the model (3 files a json, labels and binary file)
Now that tensorflowJS model needs to be converted to a tflite file and then a c-header file. the last step is easy the first step can be done in multiple ways.
You can also upload the 3 files onto your laptop. click show file uploading, find the three files load them and view your model structure

https://github.com/hpssjellis/tensorflowjs-to-arduino-for-tinymljs
https://colab.research.google.com/drive/1OgCcKhklL3EH_SdWHdtlb5dbtYvjGQnn?usp=sharing
If successful it will look like this
https://github.com/hpssjellis/tensorflowjs-to-arduino-for-tinymljs or gitpod load https://gitpod.io/#github.com/hpssjellis/tensorflowjs-to-arduino-for-tinymljs
.
Download the TensorflowLite Arduino Library https://github.com/hpssjellis/RocksettaTinyML which was adapted from eloquentArduino

Here is the c-header file

For your microcontroller run the example first to see if it works, then replace the c-header byte code with your code.
Load the serial monitor and see if you are getting classifications on your live data.
.