ISR interrupt routine

Hello every one,
I construction a ISR interrupt routine us follows (routine working)
sketch_jul30a.ino (663 Bytes)

How to replace a function digitalWrite() with Port register (the routine is external control LEDS with Buttons)
Thanks

Welcome

Please post your sketch inline in the topic using code tags. If you don't know how to use code tags, please read How to get the best out of this forum.

You will need to consult the schematic of the board that you're using to know what the pins 11 and 12 are in processor terms; after that you can fiddle with direct port manipulation.

Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

While we wait for the code, google

 Arduino direct port manipulation

and read a few articles. It is fairly easy, just follow the examp,es.

HTH

a7

I construction a ISR interrupt routine us follows (routine working)
Why use an interrupt ?

How to replace a function digitalWrite() with Port register (the routine is external control LEDS with Buttons)

What’s wrong with digitalWrite() ?

1 Like

Less complicated than direct port manipulation and faster than digitalWrite() is digitalWriteFast().

Interrupts are not really appropriate for anything that is human actuated.

Thank you very much i will use the library !

Στις Σάββατο 30 Ιουλίου 2022 - 07:47:35 μ.μ. EEST, ο χρήστης groundFungus via Arduino Forum notifications@arduino.discoursemail.com έγραψε:

| groundFungus Karma: 1200+
July 30 |

  • | - |

Less complicated than direct port manipulation and faster than digitalWrite() is digitalWriteFast().

Interrupts are not really appropriate for anything that is human actuated.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.