I'm new to Teensy (and microcontrollers like Arduino, etc) and I have a question.
What is the best method for trigger an event (code) when a push-button is pressed?
It looks like I have three options: (?)
1) Use interrupts (ie. attachInterrupt method).
2) Use Bounce library and check for fallingEdge, etc.
3) Write my own code to check pin state every loop iteration and make sure each state change is only fired once.
What is the best/easiest approach?
It seems like using interrupts with attachInterrupt is the easiest since it will have the Teensy board call my function exactly one time (?) when my push button is pressed.
Is that right? Do I also need to worry bounce/debouncing?
What is the best method for trigger an event (code) when a push-button is pressed?
It looks like I have three options: (?)
1) Use interrupts (ie. attachInterrupt method).
2) Use Bounce library and check for fallingEdge, etc.
3) Write my own code to check pin state every loop iteration and make sure each state change is only fired once.
What is the best/easiest approach?
It seems like using interrupts with attachInterrupt is the easiest since it will have the Teensy board call my function exactly one time (?) when my push button is pressed.
Is that right? Do I also need to worry bounce/debouncing?