Is there some s*** bug with arduino software or something?
Doesnt matter 1 tit what i try to use as a input/data pin for RPM reading of a fan..
I can upload with a bogus pin as rpm, still it will only read from pin 2 (4th from top left on 328p)
There are evidently two different pins involved in this code:
lombriz:
attachInterrupt(0, FanSpeed_RPM, RISING);
This code causes FanSpeed_RPM() to be called whenever pin 2 (interrupt 0) goes from LOW to HIGH. For more information, see:
Note that it's recommended to use digitalPinToInterrupt() rather than just specifying the interrupt number directly in attachInterrupt(). That, in addition to not using a magic number for the interrupt pin likely would have prevented all your confusion.
pert:
There are evidently two different pins involved in this code:This code causes FanSpeed_RPM() to be called whenever pin 2 (interrupt 0) goes from LOW to HIGH. For more information, see: attachInterrupt() - Arduino Reference
Note that it's recommended to use digitalPinToInterrupt() rather than just specifying the interrupt number directly in attachInterrupt(). That, in addition to not using a magic number for the interrupt pin likely would have prevented all your confusion.
Oh boy, gonna shoot myself with a gluegun.
Never realized the first variable passed to attachInterrupt() was the actual interrupt reference.
So much for "tweaking".