Hi, i want to know if someone could help me in my simple school project, I need to control 2 MG995 servos with 3 push buttons and an arduino uno.
Here's how it works, the buttons is connected to D2-D4 pin with input pullup and the servos is connected to PWM pin D6 & D9, the servo is powered directly from arduino 5v pin.
If none of the buttons is pressed, both servos will be in the following position (pos = 34, pos2 = 29).
If the first button is pressed, the first servo will move to the 75 degree position, and remain in that position for 4 seconds before returning to the initial position (pos = 34).
If the second button is pressed, the second servo will move to the 75 degree position, and remain in that position for 4 seconds before returning to the initial position (pos2 = 29).
if the third button is pressed, both servos will move to the 75 degree position, and remain in that position for 4 seconds before returning to the initial position (pos = 34, pos2 = 29).
The problem is, the third button won't work and it only manage to activate the second servo. is there a problem with my program?
Please post your working sketch here for the benefit of other users
Did you note the warning about powering the servos directly from the Arduino ? They can take more current than the Arduino can provide, particularly when the servo is stalled
the serial monitor thing is matter, it is to monitor if arduino is working properly or not, because I once got a servo that was damaged, thought the damage was in the Arduino but I was wrong after prove it using serial monitor.
My assignment doesn't mention this because it's not what the teacher need
Then I would question the teacher over what happens in this case. Having supervised many projects myself while I worked at a UK University I would be pleased and give the pupal extra credit for this.
Or if you do not want to do this, then just include the case anyway, it is easy enough to do.