clockCyclesPerMicrosecond()/ clockCyclesToMicroseconds()/ microsecondsToClockCycles()
Abstract
These macros convert the number of clocks and time(in microsecond).
Source Code
The clockCyclesPerMicrosecond()/clockCyclesToMicroseconds()/microsecondsToClockCycles() is defined in hardware/arduino/avr/cores/arduino/Arduino.h as below.
|
|
The clockCyclesPerMicrosecond() shows the number of clocks a micro second.
F_CPU is (maybe) uses uno.build.f_cpu defined in hardware/arduino/boards.txt. In case of Arduino Uno it is 16000000(=16MHz). As a second is 1000*1000 microseconds, it is 16 which is F_CPU divided by 1000000.
The clockCyclesToMicroseconds() converts the number of clocks to microseconds.
The microsecondsToClockCycles() converts the microseconds to the number of clocks.
Version
Arduino AVR Boards 1.8.6
Last Update
March 21, 2023