Trouble with Query Pulse width... example code? , SSC32U, Arduino

Hello,
i am currently trying to build a Hexapod. I managed to write Sequences on the Arduino IDE and control the Servo´s over TX/RX with the SSC32U. What i did was putting delays between the commands like :

Serial.println(“#0 P 1500 T1000);
delay(1100);
Serial.println(”#0 P 1200 T1000);
delay(1100);

Which did work fine! But as next Step i want to control the Speed with a external variable
therefore i want to request the movement Status with command QP( SO i wont send the next command while movement isnt finished). For some Reason i just get -1 in the Serial Monitor which stands for “no Data received” . Arduino and SSC32U are Grounded together. Below ist my Test with QP.

Serial.println(“QP0”);
position = Serial.read();
Serial.print("POSITION ");
Serial.println(position);

Is there someone who could provide a example code with arduino + SS32U for so i could test? Maybe it´s a hardware Error on Arduino/SSC32U?

Is there another way “blocking” the next command and to wait till actual movement has finished ?

Greets from Germany :slight_smile:

@weintraube Welcome to the RobotShop Community. Why not take a look at the preexisting Phoenix hexapod code?

These use the (old) PS2 controller as input, but you can adapt that.

Ex: https://www.youtube.com/watch?v=ZkuH77skH3A&ab_channel=RobotKingdom
The BotBoarduino is effectively an Arduino Duemilanove with a bunch of extra IO and features, so you can easily use another Arduino instead.

1 Like