interrup hangs up although function works in plain new sketch

(deleted)

2.62.ino (21.7 KB)

Interrupt service routines are intended to be as short as possible. Yours looks rather complex. Interrupts are suspended while processing your routine, which is a problem because you're trying to use millis for timing and it's driven by, you guessed it, an interrupt.

You need to rethink your use of interrupts.

(deleted)

(deleted)

Hello

wildbill:
....wich is a problem because you're trying to use millis for timing and it's driven by, you guessed it, an interrupt.

millis(); can be called in an ISR without problem , BUT millis() is stopped.

Regards,
bidouilleelec

To clarify what you said, bidouilleelec, you can call millis() to get a snapshot of when the ISR was called but you can't use it for timing loops etc. within the routine, correct?

Scottawildcat:
To clarify what you said, bidouilleelec, you can call millis() to get a snapshot of when the ISR was called but you can't use it for timing loops etc. within the routine, correct?

exactly

Scottawildcat:
you can call millis() to get a snapshot of when the ISR was called but you can't use it for timing loops etc. within the routine, correct?

Which is not a problem as you would not have any timing loops etc in an ISR.

    if (stimmen = true)

I think you mean:

    if (stimmen == true)

Or, since 'stimmen' is a boolean:

    if (stimmen)

Check for '=' vs '==' in the rest of your code. It is a very common mistake.

Note: For the case of "if (boolVar == false)" it is shorter to say "if (!boolVar)".