Arduino - How to Compute a Duration with micros()

Поділитися
Вставка
  • Опубліковано 18 жов 2024

КОМЕНТАРІ • 7

  • @TRCVJU
    @TRCVJU Рік тому

    Very nice and very useful. Thanks for sharing.

  • @ipadize
    @ipadize 2 роки тому +1

    for the time to be displayed more accurate you have to use the dtostrf() function which converts the float/double to a string iirc

  • @johnx9318
    @johnx9318 2 роки тому

    Tres bien! You are very good at explaining a principle very clearly. Thank you.

  • @sewingmachinesindetail
    @sewingmachinesindetail 11 місяців тому

    Thank you for explaining this function. I have got an encoder signal from a slow running motor, and I guess a way could be to measure the time between pulses using this micros function. I guess some hardware counter is used and you read that counter by micros. I looked in the hardware description for ATmega328P, but could not identify this counter. Do you know the name of this counter?

  • @ipadize
    @ipadize 2 роки тому

    you can also write this: Serial.print(String("Duration: ") + (duration));
    that makes it a little more tidy

  • @saimum_hassan
    @saimum_hassan 2 роки тому

    You are a true legends!

  • @harshruhela2283
    @harshruhela2283 2 роки тому

    Thank you Sir🙏