Open
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:
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