I am using the KL25Z with code warrior (10.5) for the IDE. I need a external push button that will interrupt my code so that I can have some timers and other bits performed.
Anyone have a simple push button interrupt example I could take a look at? Any help would be appreciated.
Thank you for the reply. I have resolved my problem with the accelerometer. However, I do have a new question.
I want to use a push button switch that i will connect to ground and pin PTA5. i then want to read PTA5 when I press the button and have my program (do something)
Setting are below. Should I set the pull up resistor also? And how do I read PTA5, should I read the memory location?
/* Turn on clock to PortA module */
SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK;
/* Set the PTB18 pin multiplexer to GPIO mode */
PORTA_PCR5 = PORT_PCR_MUX(1);
/* Set the pins direction to input */
GPIOA_PDDR |= (0<<5);