I’m having difficulty getting proper results when using digitalReadFast.
The attached program works fine with digitalRead, but when I switch (uncomment) digitalRead with digitalReadFast I get unpredictable results. ( No change to wiring or ports used )
I added the <digitalWriteFast.h> library and the results shown at the bottom show the difference between toggling the DigitalRead and digitalReadFast lines.
This original code is courtesy of Ryan Boland from.
The code was tested on an Arduino UNO using pins D2 and D3 connect to my Futaba RC Receiver. ( INT0 and INT1)
Things that I have tried to no avail:
- removed the EnableInterrupt.h and went back to attachinterrupts.
- tried a 10K resistor on the input pin.
- changed the digitalwrite and pinmode to the “Fast” version.
- changed the interrupt to RISING
- changed the pinmode to INPUT_PULLUP
I’m sure I’m just doing something dumb, but I would appreciate some guidance.
DigitalReadTest.ino (1.33 KB)