switch depress from danni debounce code

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

I'm trying to do a switch depress routine from danni debounce code, in my understanding I may need to keeping the prvious fixed debounce data, then compare with the currently fixed data and finally judge whether there is any change ? Could some one help me to guide ? My understanding correct or not ?

Regards,

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you need this in order to do auto-repeating keys then one variant of Danni's code already has this. Look here: https://www.avrfreaks.net/index.p...

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JohanEkdahl

Thank you for your help, in my understanding that for a repeat routine ? I'm looking for a depress routine.

Regards,

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

firmware wrote:
I'm trying to do a switch depress routine from danni debounce code

If you meant the release event, define a further variable key_release and insert:

...
key_press |= key_state & i;      // 0->1: key press detect
key_release |= ~key_state & i;      // 1->0: key release detect
...

But I can never think any practical usage of it, since any human expect reaction on pressing the key.

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Peter

Thank you for your clever debounce routine.

Quote:
But I can never think any practical usage of it, since any human expect reaction on pressing the key.
It just my wonder.

Regards,