I am following a programming build in Arduino and I came across this code here:
ISR(PCINT2_vect) {
hall3state = digitalRead(hall3);
NextStep();
}
ISR(ADC_vect) {
int x = ADCH; // read 8 bit value from ADC
OCR1B = map(x,0,255,1,799);
}
I don't understand how the functionality of this code works. Are these 2 ISR()
code snippets functions? If so how does this function get called because there is nowhere else in the code that calls ISR()
. Also how is there 2 different functions with the exact same name? If you call ISR()
how do you know which one will get called?
I don't need you to explain what the code is doing, I just don't understand how the computer knows when to run these functions because we never call it anywhere else in the code.
If you need to download the entire code you can get it here
int
(stackoverflow.com/questions/18421735/…). Ah, those were the days \$\endgroup\$main(a){for(;++a<28;)putchar(95+a);}
is an entire program that prints the lower-case alphabet. (Assuming it runs with argc=1) \$\endgroup\$