unsigned long timeNecessary1 = 0; unsigned long timeNecessary2 = 0; timeNecessary1 = micros(); IRscan(); // this is my function timeNecessary2 = micros(); Serial.begin(9600); Serial.println(""); Serial.println(timeNecessary1,DEC); Serial.println(timeNecessary2,DEC);
Is all the code yours or did you obtain some of it from someone else? If it is all yours then interrupts are not an issue. If you have obtained some of it from another source then search for "sei" and "cli" calls.Which libraries are you using?
...is that call inside loop?
The code is all mine except for the SoftwareSerial library which I am also using to print the results.
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16