# Installations
- Install essential software tools such as Visual Studio Code, Platformio, and Wokwi to create a comprehensive environment for coding and simulation.
- Ensure that you have the necessary libraries and extensions installed to support TinyML functionalities.
In vscode, install Platformio and Wokwi plugins.
# Steps to simulate
This guide aims to facilitate the simulation of TinyML projects using various tools and platforms, focusing on ease of use and effective implementation. The process is designed to cater to beginners and advanced users, offering step-by-step instructions to streamline development.
Arduino Code Test with Wokwi: Here, you'll guide users through creating and testing code for Arduino boards using Wokwi simulation.
link: https://wokwi.com/projects/412657365403120641
PlatformIO Code Test with Wokwi in VSCode: Create a project in PlatformIO and structure it like the image shown. You need to use Wokwi within VSCode.
Start by setting up a new project in your chosen development environment. Organize your files systematically to facilitate easier navigation and modifications later on.
In this step, you have to create a new folder named "wokwi"
Here you have to create two files: 1) diagram.json, 2) wokwi.toml, and create 1 folder named "build", here is where you can put.uf2 and.elf.
Classification Code in Colab: A walkthrough of writing and testing machine learning classification algorithms in Google Colab.
code: https://colab.research.google.com/drive/1qNYQmqmO3ggYPNWghPTNEF7TuXnNx5cG?usp=sharing
Once satisfied with the simulation results, prepare your TinyML model for deployment on actual hardware. Convert your trained model into a format compatible with your target device.
9. Converting TensorFlow Lite Model to.h FileThis section shows users how to take a trained TensorFlow Lite model and convert it into a .h
file for deployment on microcontroller projects. You'll explain the necessary steps and tools for this process.
10. Adapting the Code to PlatformIOFinally, you will demonstrate how to adapt the machine learning code and integrate the TensorFlow Lite model into a PlatformIO project. This ensures the code can run on actual hardware after simulation and testing.
Upload "model.h" and adapt the code.
In your code in src/main.cpp, you have to adapt like this:
Install library ArduTFLite following this step:
Compile your project and copy the files.elf and.uf2 to the built-in wokwi folder. Then, you can change the path in wokwi.toml.
Finally, press F1 and select simulate with wokwi.
Comments