In this project, we are going to do a machine learning (KNN) with the ESP-WROOM-32, we need to use PlatformIO to do a machine learning (KNN), firstly we have decided to do a blink to see that everything is fine and it works correctly.
Here's a image of the codes we used
As you can see in the image there are some codes which are marked, what these codes mean is that it is defining the specific board that I am using and also so that errors do not arise that the board is not detected
Here are several images, in the first you can find the blink code and in the second you can see an image of the circuit with the LED on
After checking that all the pieces we need for our project work we decided to start doing 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. The first step I took was to place the TSC3200 color sensor and we have connected it as it appears in the following pictures:
After connecting all the cables where the color sensor corresponds, they turn on and work correctly. We started doing our machine learning project and the first thing we did was download some libraries we needed to make the code work.(all the information is taken from this page), we put all the codes to see if we were lucky and it worked for us at first, but a lot of errors started to appear
Several errors came out, one of the errors was that it did not detect any microcontroller, to solve this error we had to write two lines of code explained above. 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 We used another code to make sure that the fault was not in the circuit or the microcontroller. With this code we used the sensor to see that it detected the colors correctly, and finally we got it, here is the sample video: