Hello, I need your help with this Arduino code that I do not know what went wrong. My goal for this project is control two servo motors with the first button and the other two servo motors with the second button. I connected it to my portable power bank and successfully uploaded the code to the Arduino Uno board. I see one-button control two servo motors work but the second button that controls the other two servo motors didn't work. I might miss something in the code. Can you please help me out? Thank you.
Sorry, but no help is available until you either show a schematic drawing of how you have all this actually connected together. Or at least a block diagram showing the same.
Paul
are you sure both buttons are wired to the correct pin and presumably ground.
the print for both buttons is the same. shouldn't then be, for example, "button 2 is pressed"
both angle1 and angle2 are used for both buttons. so it's conceivable that the "other" button toggles the angle to what the servo is already set to. presumably each servo should have a separate angle variable
and of course you and google know that "code tags" means to use the </> button (?)
I tried adding separate angle variables. The result is still the same. I changed the print for buttons. Nothing change. It showed that one button that controls two servos is functioning and the second button for the other two servos didn't.
That little triangles represent the ground. Sorry for the confusion. Each servo come with three wires: positive, negative, and data so that triangles are "negative"
} //<--------this right here is what missing the bracket! so I added it
Guys, I finally figured it out!! I found out why that second button that controls two servo motors is not functioning. It's the missing bracket all along! I added the last bracket and it finally works!
Thank you guys for all your efforts to help me out. I appreciated it!