Example files for 6servo

The 6-servo controller board can drive up to 6 servos, or 6 chains of WS2812B LEDs, using one of the world's cheapest microcontroller, the STM8S003F3P6.

This FW demonstrates its use to drive servos, and this other FW demonstrates its use to drive WS2812B LEDs.

Source code at Gitlab

There are two branches of this project:

simple - Simple blinky

Just a simple RED/GREEN blinky for the first tests.

standard - Standard command set

Communication format is 115200 baud, no parity, one stop bit. Commands start with a command letter, and end with '\n'.

Rxx

Set red led intensity. xx is hexadecimal. 00 = off, FF = full on.

Gxx

Set green led intensity. xx is hexadecimal. 00 = off, FF = full on.

Pnxxxx

Set PWM for servo control.
n= 1..6.
xxxx= high time in milliseconds. Hexadecimal.
3E8= left position, 5DC= mid position, 7D0=right position.

Kn

Query key status. The answer will be Kns.
n = 1..3 key number. MODE = 1, UP = 2, DOWN = 3
s = 0..1 key status. Pressed = 1, not pressed = 0

UUU

Identify. And later may be used for automatic baud rate detection. Please send it first after power on.

V

Get version number.

@xx

Execute test command. Currently known commands:


Key press and release events are reported without asking in the following format:

kns

n = 1..3 key number. MODE = 1, UP = 2, DOWN = 3
s = 0..1 key status. Key make = 1, key break = 0

See also