How to Keep the LED...
 
Notifications
Clear all

How to Keep the LED light on untill button is pressed again ?

3 Posts
2 Users
0 Likes
1,982 Views
Gulshan
(@gulshan)
Member
Joined: 4 years ago
Posts: 127
Topic starter  
This topic was modified 4 years ago by Gulshan

   
Quote
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1073
 

You just need to add a boolean variable that you "toggle" and invert its value each time you receive a signal.  So when the first signal comes in you toggle it HIGH, next time it gets toggled LOW. You use that boolean (instead of the incoming trigger) to control the LED state.

The easiest way to explain that would be to have you look at the article I wrote on using IR Remote controls. In one of the experiments I do exactly what you are asking, except with an IR remote.

?

Bill

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
ReplyQuote
Gulshan
(@gulshan)
Member
Joined: 4 years ago
Posts: 127
Topic starter  

@dronebot-workshop

Ok, Thank You I will try it. 


   
ReplyQuote