Group assignment is here
For this week I chose processing to visualize my code. The idea is quite simple to control the servo motor using a lever on the panel. For this, we create two sketches. Processing and Arduino interact through a serial port. The processing feeds the board's serial port, reads the board and gives a command to the servo. Since my servo has a rotation angle of 360 degrees, it was set that when the mark deviates to the 90 position, the servo will stop, and depending on whether the angle is less than 90 or more than 90, it will rotate to the right or left
The connection diagram of xiao-esp32s3 and servo motor.The primary communication between the software environments occurs via the serial port. Therefore, an important requirement is that the board must first be connected and recognized in the Arduino IDE. After that, the Processing code selects the first available serial port from the list. If the port used by Arduino is not the first, the program will not work. In such cases, the code must be modified in the section responsible for selecting the serial monitor.
Next, the Arduino code checks for data in the serial port. If data is present, it writes it as the movement point for the servo motor.This part of the Processing code is responsible for graphical visualization.
<the final sketch is here