This is a simple example of how to use the CH552 to control the PWM and frequency of the device.
- CH552
- sdcc compiler
- ch552.h
- Download the code
- Compile the code
- Upload the code to the CH552
- Connect the CH552 to the computer
- Open the serial terminal with the baud rate of 9600
- The CH552 will receive the commands from the serial terminal and will change the PWM and frequency of the device.
pwm<0-255>;
freq<0-30000>;
change the pwm to 100
pwm100;
change the frequency to 1000
freq1000;
Note
Send commands with the correct format, otherwise the CH552 will not understand the command.
Warning
The CH552 will not accept values out of the range.
This code is under GPL v3 license.