Hi,
I'm working on a project to control 5 servo motors at once using the HC-06 module. I seen some code online that has helped me but I'm a little confused on this certain part.
unsigned int servopos = BTSerial.read();
unsigned int servopos1 = BTSerial.read();
unsigned int realservo = (servopos1 *256) + servopos;
Serial.println(realservo);
Why do we need to have two unsigned int servopos when controlling the motors. I understand multiplying it by 256 to change from one byte to two but why have two servopos and add them?
probably a dumb question but why are we receiving a high and low byte values if im trying to set a slider to move the servo at any angle between 0 and 180 degrees and to then have it mapped out like this int servo1 = realservo; servo1 = map(servo1, 1000, 1180, 0, 179);
i understand on the MIT website ive set the range for each slider between 1000 and 1180 and 2000 2180 etc but to then have 0, 179 after it?