Machine learning with ESP-WROOM-32 (KNN)

In this project, I want to do a machine learning (KNN) with the ESP-WROOM-32, to do this, we need to use PlatformIO, so first we tried a blink to check that everything works correctly, but we had to change one thing to make it work that I will explain below

Here's a image of what we added

code added

I have added the two codes that are marked in the image that what they mean is that it is defining the specific board that I am using, so that there are no errors that the board is not detected

Here's an image of the blink code and the real circuit

code blink circuit

The KNN project

After verifying that blink works correctly and detects the board, we proceeded to start our machine learning project with the KNN algorithm with the TCS3200. KNN is the method of the k nearest neighbors, it is a supervised classification method that is used to estimate the density function of the predictors x for each class. First of all we have connected the TSC3200, which is a color sensor to avoid surprises later and we connect it as follows:

tcs32200
tabla
This is a table where to connect each port

Connected everything in the same way, the sensor turns on and works correctly, we start working on our project to try to get machine learning. First we download the necessary libraries for the code to work (all the information is taken from this page), and we put all the code at once to see if we were lucky and everything worked the first time, but as we expected, various errors began to appear.

code code code code code

The first error was that it did not detect any microcontroller, and that is that we had forgotten to add the two lines of code explained above and the first error disappeared. The other error was that the code not detect the library Adafruit_Neopixel, and we had to move the file inside the folder and put exactly the same name that the file had, and we realized that the "_" was missing, we put it and it read it correctly. Then we fixed a couple more bugs that were in the code, such as signs like "{" or ";" and finally we got the code to be ok. We thought we were on the right track until when we passed the code we got multiple errors that told us that files were missing in various folders that until today (06/05/2022) we have not been able to solve.

code
This is the error that unfortunately we have not been able to solve

To make sure that the fault was not due to the circuit or the microcontroller, we used another code to make the sensor work and see if it detects the colors correctly, and yes, we had everything connected correctly, here is the sample video: