Welcome to STM32F103RCT6 Core board repository
1.Turn on RGB light
Illuminate the on-board RGB light
Illuminate the on-board RGB light1.RGB introduce2.RGB Driving principle3.Analysis of important codes driving RGB lights4.Experimental effect
1.RGB introduce
The STM32F103RCT6 development board is equipped with an RGB lamp with the model of RGB-1210.For specific introduction, please move to the RGB folder of the hardware data and study it by yourself.
2.RGB Driving principle
Through the introduction of the hardware manual and the schematic diagram of STM32F103RCT6

conclusion:
- It is controlled by 3 IOs.
- These three IOs can switch high and low levels separately to get different colors, and can switch 7 colors.
- The three IO ports can turn on the RGB light when given a low level, and turn off the RGB light when given a high level.
3.Analysis of important codes driving RGB lights
xxxxxxxxxxint main(void){ u8 i; BSP_init(); while(1) { if(Key1_State(0)) LED =!LED; i++; if(i>=color_max) i =red; RGB_control(i); delay_ms(3000); }}- BSP_init():This function is used to initialize the control of three pins of RGB light, on-board buttons and on-board blue LED light
- RGB_control():This function controls the seven colors of RGB lights
4.Experimental effect
After downloading the program into the core board, you can observe
- The seven colors of RGB will be changed at intervals
- The blue LED on the board is off. When the key 1 on the board is pressed, the blue LED will flash continuously.