优化了平衡,尤其对于向后倾倒的几种极限情况进行优化

This commit is contained in:
myperworld committed 2025-08-16 22:32:06 +08:00
1 parent 10aba2664d
commit fcb8af8163
693 files changed
+2427 -70

No files matched your search

@@ -0,0 +1,35 @@
/*
The RegWritePos example passed the test in SCS15,
and if testing other models of SCS series servos
please change the appropriate position, speed and delay parameters.
*/
// the uart used to control servos.
// GPIO 18 - S_RXD, GPIO 19 - S_TXD, as default.
#define S_RXD 18
#define S_TXD 19
#include <SCServo.h>
SCSCL sc;
void setup()
{
Serial.begin(115200);
Serial1.begin(1000000, SERIAL_8N1, S_RXD, S_TXD);
sc.pSerial = &Serial1;
delay(1000);
}
void loop()
{
sc.RegWritePos(1, 1000, 0, 1500);//Servo(ID1) moves at max speed=1500, moves to position=1000.
sc.RegWritePos(2, 1000, 0, 1500);//Servo(ID2) moves at max speed=1500, moves to position=1000.
sc.RegWriteAction();//Start moving.
delay(754);//[(P1-P0)/V]*1000+100
sc.RegWritePos(1, 20, 0, 1500);//Servo(ID1) moves at max speed=1500, moves to position=20.
sc.RegWritePos(2, 20, 0, 1500);//Servo(ID2) moves at max speed=1500, moves to position=20.
sc.RegWriteAction();//Start moving.
delay(754);//[(P1-P0)/V]*1000+100
}