I have this code but i need to alter it to be for the rising edge of pin B2, ive had a look at the datasheet and does the INT0, get changed to INT2? Im just a little unsure and im very new to the ATMEGA324A and avr
/* Set up interrupt to occur on rising edge of pin D2 (start/stop button) */ EICRA = (1<<ISC01)|(1<<ISC00); EIMSK = (1<<INT0); EIFR = (1<<INTF0);
This is the current code block I want to add it to: clock
Ticks = 0L;
/* Clear the timer */
TCNT0 = 0;
/* Set the output compare value to be 124 */
OCR0A = 124;
/* Set the timer to clear on compare match (CTC mode)
* and to divide the clock by 64. This starts the timer
* running.
*/
TCCR0A = (1<<WGM01);
TCCR0B = (1<<CS01)|(1<<CS00);
/* Enable an interrupt on output compare match.
* Note that interrupts have to be enabled globally
* before the interrupts will fire.
*/
TIMSK0 |= (1<<OCIE0A);
/* Make sure the interrupt flag is cleared by writing a
* 1 to it.
*/
TIFR0 |= (1<<OCF0A);