This simple project demonstrates a few tricks that can be done with one of the world's cheapest microcontroller, the STM8S003F3P6.
There are three branches of this project:
Just a simple RED/GREEN/BLUE blinky for the first tests.
Communication format is 115200 baud, no parity, one stop bit. Commands start with a command letter, and end with '\n'.
Set red led intensity. xx is hexadecimal. 00=off, FF=full on.
Set green led intensity. xx is hexadecimal. 00=off, FF=full on.
Set blue led intensity. xx is hexadecimal. 00=off, FF=full on.
Set PWM for servo control.
xxxx= high time in milliseconds. Hexadecimal. 3E8= left position, 5DC= mid position, 7D0=right position.
Identify. And later may be used for automatic baud rate detection. Please send it first after power on.
Get version number.
Execute test command. Currently known commands:
The same as standard, but R, G, B commands have four digit hexadecimal parameters.