The wCK_Series library provides an easy-to-use interface for controlling wCK servo modules via Arduino. It supports position, speed, torque, and configuration commands, as well as reading feedback from the servos. The library is designed for modular robotics and automation projects using wCK servos.
- Download or clone this repository.
- Open Arduino IDE.
- Go to Sketch > Include Library > Add .ZIP Library... and select the downloaded folder.
- The library will be available under Sketch > Include Library.
- wCK Series servo modules (e.g., wCK-XX, wCK-XXH)
- Arduino boards with HardwareSerial support
- Include the library in your sketch:
#include <wCK_Series.h>
- Create a
wCKobject, passing a pointer to your HardwareSerial port:wCK servo(&Serial1); - Initialize the serial communication:
servo.begin(WCK_115200_BAUD_RATE);
- Use the provided API to control and read from your servos.
wCK(HardwareSerial *SerialPort);
void begin(unsigned int BaudRate, uint8_t config = Null, uint8_t rx = -1, uint8_t tx = -1);
Response_packet PosSend(char ServoID, char TorqueLevel, char Position);bool PosSendH(char ServoID, char TorqueLevel, int Position);void SyncPosSend(char LastID, char TorqueLevel, char *TargetArray);Response_packet Rotation360(char ServoID, char SpeedLevel, char RotationDir);char PassiveCK(char ServoID);char BreakWCK(void);
bool setBaudrate(char ServoID, char NewBaud);bool setPDGain(char ServoID, char *NewPgain, char *NewDgain);bool setIGain(char ServoID, char *NewIgain);bool setRuntimePDGain(char ServoID, char *NewPgain, char *NewDgain);bool setRuntimeIGain(char ServoID, char *NewIgain);bool setId(char ServoID, char NewId);bool setSpeed(char ServoID, char NewSpeed, char NewAccel);void setRuntimeSpeed(char ServoID, char NewSpeed, char NewAccel);bool setOverLoad(char ServoID, char NewOverLoad);bool setBoundary(char ServoID, char *NewLBound, char *NewUBound);
Response_packet getPos(char ServoID);int getPosH(char ServoID);char getPDGain(char ServoID, char *Pgain, char *Dgain);char getIGain(char ServoID, char *Igain);char getSpeed(char ServoID, char* NewSpeed, char *NewAccel);char getOverLD(char ServoID);char getBound(char ServoID, char *LBound, char *UBound);
Response_packetstruct: containsloadandposition.
See wCK_Series.h for baud rate, overload, and rotation direction constants.
#include <wCK_Series.h>
wCK servo(&Serial1);
void setup() {
servo.begin(WCK_115200_BAUD_RATE);
Response_packet feedback = servo.PosSend(1, 0, 128); // Move servo 1 to position 128 with max torque
int pos = servo.getPosH(1); // Get high-precision position
}
void loop() {
// Your code here
}#include <wCK_Series.h>
wCK servo(&Serial1);
char targets[4] = {100, 120, 140, 160};
void setup() {
servo.begin(WCK_115200_BAUD_RATE);
servo.SyncPosSend(3, 0, targets); // Move servos 0-3 to target positions
}
void loop() {
// Your code here
}- Initial release
- Full API for wCK servo control
- Position, speed, torque, and configuration commands
- Feedback reading support