Still working on my Teensy 2.0 stepper motor project. I am using a 4x4 keypad for input and have noticed an issue when running the stepper a step at a time in the Loop() code. Using the Keypad library and normal keypad.getKey(); in the Loop(). This creates a delay in the loop while it is scanning the keypad which is causing issues with my stepper code.
What I would really like to do is move the keypad code out of the loop and have it interrupt driven. Pressing a key tells the Teensy via an interrupt it's time to read the keypad. I have rewired the Teensy pins to free up one interrupt pin (7), about the best I can do and still have everything working. The keypad is connected to pins 12 through 19 and it would be a major ordeal to change.
My question is.. Is there a trick way to have the keypad trigger an interrupt on pin 7 when a key is pressed and would putting the Keypad.getkey() in the ISR code work? I did search the net but didn't come up with anything useful for my situation.
Thanks...
What I would really like to do is move the keypad code out of the loop and have it interrupt driven. Pressing a key tells the Teensy via an interrupt it's time to read the keypad. I have rewired the Teensy pins to free up one interrupt pin (7), about the best I can do and still have everything working. The keypad is connected to pins 12 through 19 and it would be a major ordeal to change.
My question is.. Is there a trick way to have the keypad trigger an interrupt on pin 7 when a key is pressed and would putting the Keypad.getkey() in the ISR code work? I did search the net but didn't come up with anything useful for my situation.
Thanks...