Study for the Internet of Things (IOT102) Test. Access comprehensive flashcards and multiple choice questions, each with hints and explanations. Get prepared for your exam!

Multiple Choice

Which digital pins can be used in Arduino Nano/Uno to provide an interrupt?

The important idea is about hardware external interrupts. On Arduino Uno/Nano (with the ATmega328P), there are two external interrupt lines, INT0 and INT1, which are mapped to digital pins 2 and 3. These pins can be configured to trigger on rising edges, falling edges, or changes, providing a fast, deterministic way for the microcontroller to respond to external events. Other pins don’t have these dedicated external interrupt lines (though some can use pin-change interrupts, they’re a different mechanism and more complex to handle). So the pins you’d use for a straightforward external interrupt on these boards are D2 and D3.

The important idea is about hardware external interrupts. On Arduino Uno/Nano (with the ATmega328P), there are two external interrupt lines, INT0 and INT1, which are mapped to digital pins 2 and 3. These pins can be configured to trigger on rising edges, falling edges, or changes, providing a fast, deterministic way for the microcontroller to respond to external events. Other pins don’t have these dedicated external interrupt lines (though some can use pin-change interrupts, they’re a different mechanism and more complex to handle). So the pins you’d use for a straightforward external interrupt on these boards are D2 and D3.