External interrupts misfiring
- Dominant language
- Java
- Stars
- 14.6k
- Forks
- 7k
- PR merge metrics
- No merged PRs in 30d
Description
Looks like attachInterrupt(digitalPinToInterrupt(2), juhu, FALLING); always akt like CHANGE.
No matter what i choose - RISING, FALLING, HIGH or CHANGE it always behave like CHANGE.
Here is the simple sketch:
```c++
void setup()
{
pinMode(2, INPUT);
pinMode(3, OUTPUT);
attachInterrupt(digitalPinToInterrupt(2), juhu, RISING);
}
void loop()
{
}
void juhu() {
digitalWrite(3, HIGH);
delayMicroseconds(200);
digitalWrite(3, LOW);
}
```
Then top two lines on the scope picture, is a nice clean square wave, made by an optocoupler.
The buttom two lines is the resulting signal on output pin 3.
No matter, if i stand on my head and sing a terrible song, or choose RISING, FALLING or CHANGE, the result is the same - always two signals with one square wave.
Can You tell me what is wrong?
I think the arduino ide translates all modes to CHANGE

Contributor guide
Research direction
Start by reproducing the supplied sketch's attachInterrupt(digitalPinToInterrupt(2), juhu, ...) behavior and compare RISING, FALLING, HIGH, and CHANGE while observing the input and output on a scope. Determine whether the interrupt mode is being handled incorrectly or whether the wiring and optocoupler produce both edges; done means the cause is identified and the selected modes behave distinctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100