Code Check for ROV

void processNumber (int n)
  {
  int x = n;

Why the reassignment?

int M1A = 3;
int M1B = 4;
int M2A = 5;
int M2B = 6;

Are you planning on changing these pin assignments whilst the program is running?
If not, consider making them constants.