Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    I would guess, that the display code needs interrupts to work during its execution, which is not the case inside an ISR. Serial will just put the data into the buffer, which then gets pushed out later via interrupts. Try to set a flag inside the ISR and then execute the display code in the main loop, if the flag was set Commented Feb 3, 2021 at 9:24
  • You don’t have to disable and re-enable the interrupts inside an ISR (in fact, you really shouldn’t). Also, an ISR should be very short (as few instructions as possible) and yours isn’t. Take @chrisl ‘s advice and set a flag inside the ISR, test for the flag in the main loop and leave handling of the display code to the main loop. Commented Feb 3, 2021 at 10:07
  • I2C communication (usually) requires interrupts. You can't use interrupts inside an interrupt. Ergo, you can't use I2C communication inside an interrupt. There's very little you can do in an interrupt. Commented Feb 3, 2021 at 10:20