Once completed you'll be able to send information about multiple servos and specify which servo the value is for
Change the output code in your HC-05 so that is sends strings in the form of:
"<servo number>:<servo value>'\n' "
So if you want the first servo to have a value of 1300, you would send:
And you can build this string using
//print 1 //print ":" //println 1300
println appends a newline character
\n to the end of the string.
We are going to assume all data strings are of the form:
<servo number>:<servo value>
Then you can use
.readBytesUntil() to read the
servoNumber and then again to read the
The servo number will decide which digital pin to
analogWrite() the servo position to. You can use if statements to make this decision
if the servo number is 1
ananlogWrite to pin 9
if the servo number is 2
analogWrite to pin 10
So you'll need one capacitor+resistor pair for each digital pin
<servo number>:<servo value>for each analogpin
analogWrite()the servoValue to the correct digital pin
If you got all of that congratulations you've mastered the basics of a remote control system!
You can add more potentiometers or buttons/switches to your controller. Or maybe you want to try building/3D printing a case for your controller.