Can I read Interrupts and Configuration Guide on EtoBox?
Interrupts and Configuration Guide by Oliver Ochoa Garcia is a document available to read on EtoBox.
What is Interrupts and Configuration Guide about?
Here are some code examples to implement the activities using interrupts on an ATTINY microcontroller: 1. Alternating LED cycles using external interrupt on HIGH signal: #define LED_PIN 1 ISR(INT0_vect){ static uint8_t led_state = 0; led_state = !led_state; if(led_state) PORTB |= (1<<LED_PIN); else PORTB &= ~(1<<LED_PIN); } int main(){ DDRB |= (1<<LED_PIN); //LED pin as output EICRA |= (1<<ISC01); //interrupt on rising edge EIMSK |=
- Author
- Oliver Ochoa Garcia
- Language
- EN