Example Code for UART Mode Control
Last revision 2026/01/27
This code can be used to control the brushless motor driver in the UART Mode.
Other Preparation Work
make sure the toggle switches on the driver are in the right position for UART Mode;
Sample Code
//Name: Sensorless BLDC Driver V1-example code in UART Mode
//Version: v0.1;
//Author: Barry from DFrobot;
// This code can be used to control the brushless motor driver in the UART Mode;
// Details in User manual;
// make sure the toggle switches on the driver are in the right position for UART Mode;
void setup()
{
Serial.begin(115200);// initial baudrate is 115200;
}
void loop()
{
Serial.print(0xff,BYTE);//motors rotating in clockwise direction with the highest speed;
Serial.print(0xff,BYTE);//communication protocols shown clearly in the User manual;
Serial.print(0x01,BYTE);
Serial.print(0x05,BYTE);
Serial.print(0x03,BYTE);
Serial.print(0x14,BYTE);
Serial.print(0x00,BYTE);
Serial.print(0xff,BYTE);
Serial.print(0xec,BYTE);
delay(5000);
Serial.print(0xff,BYTE);// motors stop
Serial.print(0xff,BYTE);
Serial.print(0x01,BYTE);
Serial.print(0x05,BYTE);
Serial.print(0x03,BYTE);
Serial.print(0x14,BYTE);
Serial.print(0x00,BYTE);
Serial.print(0x00,BYTE);
Serial.print(0x13,BYTE);
delay(5000);
}
Was this article helpful?
