RFQ/BOM 0 登錄 / 註冊

選擇您的位置

用戶形象

It is necessary to design a circuit that satisfies the LED and button sharing the IO port of an MCU. How can I meet the demand?

Hardware design
8月 06, 2020 by Brylee 1291

Requirements: LEDs and buttons share the IO port of an MCU

Goal: When the button is pressed once, the light is on, and it stays on until the corresponding button is pressed again, and the light is off

The picture I draw now cannot meet this requirement, because when the light is on, the IO port of the MCU is high, and both sides of the button are high, and it is impossible to give a signal to the MCU. How can you design to meet the demand without adding other types of components?

所有評論

user image

Cheyanne 發表於 August 6, 2020

You explain first, what kind of operation is required, that is, when the switch is pressed, MCU_IO goes from HIGH to LOW??

0
user image

Jaylah 發表於 August 6, 2020

Remove 3K, set the R value according to the actual lamp design resistance value, and exchange the LED with the switch. IO is initialized to high impedance or high level. When the button is pressed, the LED is on and the IO outputs low level. The LED is always on. When the button is pressed again, the IO outputs high level and the LED is off. Personal analysis. No verification. for reference only

0
user image

Kaliyah 發表於 August 6, 2020

See if this design is feasible?

0

寫一個答案

您需要登錄才能回覆。 登錄 | 註冊