Home - News - Details

How To Control The Brightness Level Of The LED With A Button?

Specialising in embedded systems and machine learning, welcome to the Embedded Systems Workshop ESCW.
These are two problems: key recognition and LED brightness control.

 

1. Key recognition
The mode of the button can be: long press once, short press once, long press short press alternately once, long press many times, short press many times, long press short press alternately more,... The specific length and interval parameters are adjusted according to custom.

Key recognition is the key, which can be identified by interrupt plus timing, or time interval plus state change.

 

2.LED brightness control
The current microcontroller MCU basically contains a PWM controller by default, 51 without PWM.

Press the different key modes identified to control the different display modes of the LED.

Send Inquiry

You Might Also Like