I’m trying to make an analog comparasion interrupt (needs to be interrupt!) with ntc-resistor or ldr-resistor into the arduino micro and i cannot understand that how to make it right. There is no AIN1 pin on the pin description image of arduino micro !
I made the connection work somehow with the pin 6 and the limit seems to be between 0,4volts and 1,9 volts when the interruption is triggered. If i change the wire to pin 7 it still works ! ?
Some document showd that the AIN1 would the pin RX (no number)
So IF the ain1 pin is same as RX pin how can i change comparasion interrupt from it to for example to pin 7 ? I also need the rx and tx pins for accelerometer module so they cannot be reserved to ldr-interrupt!
ACSR =
(0 << ACD) | // Analog Comparator: Enabled
(0 << ACBG) | // Analog Comparator Bandgap Select: AIN0 is applied to the positive input
(0 << ACO) | // Analog Comparator Output: Off
(1 << ACI) | // Analog Comparator Interrupt Flag: Clear Pending Interrupt
(1 << ACIE) | // Analog Comparator Interrupt: Enabled
(0 << ACIC) | // Analog Comparator Input Capture: Disabled
(0 << ACIS1) | (0 << ACIS0); // Analog Comparator Interrupt Mode: Comparator Interrupt on Rising Output Edge