Hi!
This is the snippet in question:
byte buildYValue(int yV) {
Serial.println("Y: " + yV);
if (yV <= 1000 & yV >= -1000) { //This creates a cushion for the stop value so the car is not constantly moving
return 125; //this is the stop value
}
else if (yV > 1000) { //if positive value then car is being directed right
yV = yV - 1000;
if (yV > 11000) {
yV = 11000; //ceiling value for right speed
}
return scaleSpeed(yV, 11000);
}
else { //Negative x value is to tell the car to go backwards
yV = yV * -1;
yV = yV - 1000;
if (yV > 11000) {
yV = 11000; //ceiling value for left speed
}
return (scaleSpeed(yV, 11000) + 125); //scale speed to send, add 125 since this is left
}
}
At the serial.print() part, when I remove "Y: ", the serial monitor shows the values just fine, but as soon as I add that string it starts bugging out.
Things to note:
The values are constantly being sent over a nRF24L01+
I've tried changing the baud rates to both 9600 and 2000000 - no effect