File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -213,14 +213,16 @@ void BraccioClass::motors_connected_thread() {
213213 _connected[i] = (servos->ping (i) == 0 );
214214 // Serial.print(String(i) + ": ");
215215 // Serial.println(_connected[i]);
216- i2c_mutex.lock ();
216+ }
217+ i2c_mutex.lock ();
218+ for (int i = 1 ; i < 7 ; i++) {
217219 if (_connected[i]) {
218220 setGreen (i);
219221 } else {
220222 setRed (i);
221223 }
222- i2c_mutex.unlock ();
223224 }
225+ i2c_mutex.unlock ();
224226 }
225227 delay (1000 );
226228 }
Original file line number Diff line number Diff line change @@ -63,7 +63,9 @@ template <int MAX_MOTORS> void SmartServoClass<MAX_MOTORS>::receiveResponse() {
6363 //Serial.print(c, HEX);
6464 //Serial.print(" ");
6565 _rxBuf[_rxLen++]=c;
66- delayMicroseconds(2000);
66+ if (!_RS485.available()) {
67+ delay(1);
68+ }
6769 }
6870 //Serial.println();
6971 _RS485.noReceive();
You can’t perform that action at this time.
0 commit comments