Pinguino Forum
Toggle Button ? - Printable Version

+- Pinguino Forum (http://forum.pinguino.cc)
+-- Forum: Software (http://forum.pinguino.cc/forumdisplay.php?fid=7)
+--- Forum: Syntax & Programs (http://forum.pinguino.cc/forumdisplay.php?fid=19)
+--- Thread: Toggle Button ? (/showthread.php?tid=4907)



Toggle Button ? - Aldeen19 - 23-12-2016

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.


RE: Toggle Button ? - gtcbreizh - 26-12-2016

Hi Aldeen19,
The attached pde file works for me with a 18f4550. I hope the instructions are sufficient.
Bye
André


RE: Toggle Button ? - Aldeen19 - 26-12-2016

(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.


RE: Toggle Button ? - Aldeen19 - 26-12-2016

(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.


RE: Toggle Button ? - mikronauts - 30-12-2016

FYI, I normally use 10ms as a de-bouncing delay