Get script status command

hi,
we’re using an Arduino Nano board to control a Pololu Mini Maestro 24 channel board which in turn controls a few servos to do our bidding :slight_smile:
we’ve created a procedure in the Arduino code which sends a byte of data with the 0xAE command through designated pins(in Arduino - software RX TX pins, in Maestro - hardware RX TX pins) to the Maestro board and returns what the Maestro is telling us.
it worked until a few days ago, sending 0’s and 1’s as it should, but now it returns only “255”, no matter if the script stopped or not

anybody knows what is wrong?
attached is the short proc we wrote and needed variables

//SERVO_CONTROLLER_RX_PIN & SERVO_CONTROLLER_TX_PIN are 2 & 3
SoftwareSerial ServoController = SoftwareSerial(SERVO_CONTROLLER_RX_PIN, SERVO_CONTROLLER_TX_PIN);

int getScriptStatus ()
{
      byte serialBytes[1];
      byte serialBytesReturnValue[1];
      serialBytes[0]=0xAE;
      ServoController.write(serialBytes, sizeof(serialBytes));
      serialBytesReturnValue[0]=ServoController.read();
      return serialBytesReturnValue[0];
}

we want to know when the script running on the Maestro board is finished so we can go on with the code

Hello,

I added code tags ([ code ] [ /code ] without the spaces) to your first post; please use this feature to post code in the future.

As for your question, I looked at your code and did not notice anything obviously wrong with it. Did anything in your setup change between when it was working and when it stopped working? You might try adding a delay of a few microseconds before reading the value of your Maestro’s TX line to allow enough time for you Maestro to process the command and return the resulting value.

By the way, you might consider using our Pololu Maestro Servo Controller library for Arduino to simplify your code. The library implements all of the serial commands available on the Maestros, including the “get script status” command.

- Amanda