I'm trying to get into robotics, and I've found some tutorial code that was readily available on pololu's website for one of their motor controllers which I now own. Could someone with some background in Processing explain the highlighted segments please?
#include <SoftwareSerial.h>
#define rxPin 3 // pin 3 connects to smcSerial TX (not used in this example, but needed for the smcSerial object)
#define txPin 4 // pin 4 connects to smcSerial RX
SoftwareSerial smcSerial = SoftwareSerial(rxPin, txPin);
// speed should be a number from -3200 to 3200
void setMotorSpeed(int speed)
{
if (speed < 0)
{
smcSerial.write(0x86);
speed = -speed;
}
else
{
smcSerial.write(0x85); // This Line
}
smcSerial.write(speed & 0x1F); // This Line
smcSerial.write(speed >> 5); // This Line
}