Hi,
When using the Time library, it is stated we have to replace delay(period) by Alarm.delay(period) in our scripts. It works great, but what about having our scripts also delayMicroseconds(period)?
I tested with Alarm.delayMicrosend(period); but it is not recognized. Can this feature be included manually in the library?
GPSanino:
I tested with Alarm.delayMicrosend(period); but it is not recognized. Can this feature be included manually in the library?
That function isn't part of the TimeAlarms class, thus it's not recognised. If you want to expand your local copy of the TimeAlarms class, simply copy the function delay, change it's name to whatever you want in TimeAlarms.h, TimeAlarms.cpp and keywords.txt. To change the behaviour, you also need to change in TimeAlarms.cpp in you new function the two places where millis() is mentioned to micros(). That's all.
However, if you intend to measure very short periods, the whole thing will give you very inaccurate measurements. I would estimate anything below 100µs won't really give good results due to the time used to call the various functions, timer precision and the time spent in serviceAlarms().