Controlling multiple servos with serial input


To start, I have very little coding knowledge, and I've searched this forum and elsewhere but I'm still unable to figure this out. I'm working with:

Arduino UNO + Adafruit 16-Channel Servo Driver

and I'm looking to control one or more servos with my keyboard via the Serial monitor. Servos are currently connected to the Servo Driver on channels 0, 1, 2, 3. Could anyone tell me how to control these independently using different keys, ideally such that for instance, entering 'a' would move servo @ channel 0 180 degrees, entering 's' would move it back.

If some kind person could post some code that accomplishes just that it would be much appreciated!


Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

If all you want to do is send a single character to operate a single servo then the first example should be suitable. However if you want to be able to send a single message to control several servos then I suggest you use the technique in the 3rd example.