gnupic: Re: [gnupic] about data tables and shared variables
Subject:
Re: [gnupic] about data tables and shared variables
From:
Peter Stuge ####@####.####
Date:
30 Aug 2008 19:23:45 -0000
Message-Id: <20080830192243.8477.qmail@stuge.se>
Lope Vega wrote:
> My question is about how to handle it.
A matter of taste really.
I suggest having main scanning over the LEDs and to have an
interrupt-on-change for the switch input. When the switch interrupt
fires, start timer 0. If another switch interrupt fires then restart
timer 0. When the timer 0 interrupt fires the input has been
debounced so update the values that main displays on the LEDs.
This does not scale for many inputs but if you only want one input
it's a simple solution. You can of course add a little multiplexing
code to allow handling more inputs.
//Peter