uSeconds?
-
- Posts: 166
- Joined: Wed Aug 01, 2018 12:06 pm
uSeconds?
As part of a complementary filter for a MPU unit I am using micros() to get the time passed; using millis() returns a zero. More out of wanting to know how to do it, and actually do it, if it is possible, is there a way. A more ESP32ish way to get a microsecond count then using micros()?
Re: uSeconds?
You can see the micros() function here:
https://github.com/espressif/arduino-es ... isc.c#L104
So you can use (unsigned long) (esp_timer_get_time() / 1000) if that is ESP32ish enough for you. But then, you may as well just use micros() since that's kinda the point of all this...
https://github.com/espressif/arduino-es ... isc.c#L104
So you can use (unsigned long) (esp_timer_get_time() / 1000) if that is ESP32ish enough for you. But then, you may as well just use micros() since that's kinda the point of all this...
-
- Posts: 166
- Joined: Wed Aug 01, 2018 12:06 pm
Re: uSeconds?
@ boarchuz, thanks for that info.
I also found that ESP.getCycleCount() will work as well.
I also found that ESP.getCycleCount() will work as well.
Who is online
Users browsing this forum: No registered users and 63 guests