Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Toggle Button ?
23-12-2016, 01:54 PM, (This post was last modified: 24-12-2016, 01:54 PM by Aldeen19.)
#1
Star  Toggle Button ?
Hi everybody and good day.

I have built my 18F4550 Pinguino board and still trying some simple programming examples,  but couldn't find a way to make a toggle button for an input pin.  I mean how to turn a LED On and Off by a single button?


kindly Anyone to help doing this programmatically?

Will be mostly appreciated.


Attached Files Thumbnail(s)
       
Aldeen19
Reply
26-12-2016, 11:19 AM,
#2
RE: Toggle Button ?
Hi Aldeen19,
The attached pde file works for me with a 18f4550. I hope the instructions are sufficient.
Bye
André


Attached Files
.pde   togglebutton.pde (Size: 964 bytes / Downloads: 3)
Reply
26-12-2016, 07:50 PM,
#3
RE: Toggle Button ?
(26-12-2016, 11:19 AM)gtcbreizh Wrote: Hi Aldeen19,
The attached pde file works for me with a 18f4550. I hope the instructions are sufficient.
Bye
André

My dear gtcbreizh,
I have tried the pde program file attached, it is working but it lacks debouncing.
However the code which you have sent me is inspiring and I will have to improve it.
Thanks anyway gtcbreizh.
Aldeen19
Reply
26-12-2016, 08:26 PM,
#4
RE: Toggle Button ?
(26-12-2016, 07:50 PM)Aldeen19 Wrote:
(26-12-2016, 11:19 AM)gtcbreizh Wrote: Hi Aldeen19,
The attached pde file works for me with a 18f4550. I hope the instructions are sufficient.
Bye
André

My dear gtcbreizh,
I have tried the pde program file attached, it is working but it lacks debouncing.
However the code which you have sent me is inspiring and I will have to improve it.
Thanks anyway gtcbreizh.
I also have added 500 ms delay at the end of the code and it works fine.
Thank you again.


Attached Files Thumbnail(s)
   
Aldeen19
Reply
30-12-2016, 07:59 PM,
#5
RE: Toggle Button ?
FYI, I normally use 10ms as a de-bouncing delay
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)