After running into difficulty with the Arduino taking the python coordinate outputs to rotate the motors, I decided to make sure that the motors can actually turn when manipulated. In order to do this, a mock arduino code was written that would rotate the servo in question 360 degrees, wait a few seconds and go back to the 0 degree position. See the code below:
#include <Servo.h> Servo myservo; // create servo object to control a servo
void setup() { myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() { myservo.write(360); // sets the servo position to 360 degrees delay(3500); // waits for 3.5 seconds myservo.write(0); // sets the servo position to 0 degrees delay(3500); // waits for 3.5 seconds
}
Using the test code to move the fingers we were able to get some of the fingers moving to an acceptable position whereas some weren't moving as much. After meeting up to figure out why some of the fingers weren't moving as smoothly, it was determined that some of the fingers had too much tension for the motor to rotate. Not only was tension a problem, but the spacing of the motor placement also caused a motor to not be able to turn effectively, due to it constantly rubbing on another.
In terms of the python code talking to the Arduino, when running the python program and I move my hand in the camera frame, the Arduino's receiving light flashes which shows that it is receiving the data. But the transmitting light does not. This led to the conclusion that the Arduino is able to receive the python code's data, but does not know what to do with it.
![](https://static.wixstatic.com/media/cfd036_a12f22c30a004f90882c42967a8c15f1~mv2.jpg/v1/fill/w_868,h_680,al_c,q_85,enc_avif,quality_auto/cfd036_a12f22c30a004f90882c42967a8c15f1~mv2.jpg)
I did some research to figure out what could be the problem, reading some articles, I tried turning on the serial monitor in the Arduino IDE to make sure that the serial values were indeed changing, which is what the Arduino is using as an input to move the motors. After turning on the serial monitor , I tried to run the python code, this resulted in multiple errors regarding an access denial to the serial port. After searching the error, it was found that the serial monitor is already accessing the serial port which is why the python code could not access it, therefore resulting in the code not running. Unfortunately, this time around, when running the serial monitor, nothing came up.
The next step is to hook up the external power supply to the arm and connect the Bluetooth module so that the Arduino is no longer connected to the laptop directly and see if that helps to resolve the issue.
Comentarios