Skip to main content

Questions tagged [interrupt]

Interrupts allow the processor to suspend normal operation temporarily so that a high-priority software or hardware event can be handled instead.

18 votes
1 answer
28k views

Please explain how interrupts work on the Arduino Uno and related boards using the ATmega328P processor. Boards such as the: Uno Mini Nano Pro Mini Lilypad In particular please discuss: What to use ...
Nick Gammon's user avatar
  • 38.9k
5 votes
2 answers
8k views

I am designing my own quadcopter control algorithm, whereby I currently read 4 RC receiver channels using PulseIn on each loop in the following manner: ch1_raw = pulseIn(rcPin1, HIGH, 25000); In ...
RLJ's user avatar
  • 53
1 vote
1 answer
1k views

I'm thinking about how to handle a rotary encoder. I'm planning on using interrupts and would like to use both the 'A' and 'B' phase transitions to generate interrupts. I'm wondering if there is any ...
dlu's user avatar
  • 1,671
14 votes
4 answers
56k views

The documentation for attachInterrupt() says: ... millis() relies on interrupts to count, so it will never increment inside an ISR. Since delay() requires interrupts to work, it will not work if ...
Petr's user avatar
  • 253
9 votes
2 answers
4k views

I'm trying to check the frequency of Timer3 using a counter. The value of the counter, declared as volatile, is incremented in the ISR and every second the sum is shown in the main loop and the value ...
UserK's user avatar
  • 559
4 votes
1 answer
989 views

I have recently been working on a project that I had initially been designing with an Arduino Nano, and I was able to create functioning code for my application, but for cost / space reduction I ...
Kevin Sullivan's user avatar
3 votes
2 answers
8k views

I need to put my arduino into the sleep mode in order to consume less power. My arduino receives IR data and do some work with it, but I need to make it sleep until there is no data. If the data has ...
CROSP's user avatar
  • 141
3 votes
1 answer
993 views

I'm building a battery operated device and must shutoff MOSI pin during sleep because it leaks current through the SD card if I don't (about 400 µA). Problem is, it won't stay off. I've looked at ...
DatuPuti's user avatar
  • 151
3 votes
1 answer
489 views

I´m using LowPower.h and PinChangeInt.h libraries to put my Arduino into the sleep mode every 8 seconds and then it wakes up, modifies a counter and it goes to sleep again, but also I need to wake it ...
cpinamtz's user avatar
  • 175
2 votes
2 answers
821 views

When the sketch shown at end-of-question is compiled and uploaded to an Arduino board, it is supposed to Serial-print a list of available digital pins, showing for each pin whether it supports PWM or ...
James Waldby - jwpat7's user avatar
1 vote
1 answer
5k views

(Here is finally a solution). I'm using the following code on a ATtiny45 to assign an interrupt to a button press (pin #7, PB2, INT0). However the LED doesn't blink when the button is pressed, as if ...
Basj's user avatar
  • 449
0 votes
2 answers
546 views

I want to communicate over serial to another device (dfplayer) and also set the microcontroller into sleep mode. The ATtiny85 does not have a hardware serial pin so I need to use a virtual serial (...
boop's user avatar
  • 191
22 votes
3 answers
6k views

Currently, my sketch is checking an input pin every time round the main loop. If it detects a change, it calls a custom function to respond to it. Here's the code (trimmed down to the essentials): ...
Peter Bloomfield's user avatar
21 votes
2 answers
54k views

I am looking at using a 7 channel RC receiver with the Arduino Uno R3. In the documentation, there are mentions of a maximum of 2 interrupt pins, whereas on certain other blogs I have seen mentions of ...
asheeshr's user avatar
  • 3,847
9 votes
2 answers
21k views

I am familiar with the keyword Volatile being used to declare variables that are shared among multiple threads on a software application (basically on a multithreaded application). But why do I need ...
user avatar

15 30 50 per page