- Add platformio.ini for ESP32 DevKit (Arduino framework, espressif32 6.10.0) - Vendor ArduinoJson, MPU6050_tockn, SCServo, Simple_FOC, and WebSockets so a fresh clone builds without downloading dependencies - Add .gitignore rules for PlatformIO/IDE build artifacts - Add controller PCB Gerber and drill files
32 lines
738 B
Arduino
32 lines
738 B
Arduino
/*
|
|
The normal write 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.WritePos(1, 1000, 0, 1500);//Servo(ID1) moves at max speed=1500, moves to position=1000.
|
|
delay(754);//[(P1-P0)/V]*1000+100
|
|
|
|
sc.WritePos(1, 20, 0, 1500);//Servo(ID1) moves at max speed=1500, moves to position=20.
|
|
delay(754);//[(P1-P0)/V]*1000+100
|
|
}
|