|
|
| Line 1: |
Line 1: |
| − | <yambe:breadcrumb self="Timing">ARDUINO_Functions_and_Variables|Functions and Variables</yambe:breadcrumb> | + | {{DISPLAYTITLE:328 Timing Functions}} |
| | + | <yambe:breadcrumb self="328 Timing">ARDUINO_328_Functions_and_Variables|Functions and Variables</yambe:breadcrumb> |
| | <br /> | | <br /> |
| | | | |
| long time1[TTimers timer]
|
| (long) This array holds the current value of the respective timers. Each of the timer values can be retrieved in units of 1, 10 and 100 milliseconds depending on which array is used. For example, time1[T1] retrieves the value of timer T1 in units of 1-msec and time10[T1] retrieves the value using a 10-msec tick. And time100[T1] retrieves the value using 100-msec tick. Note that the arrays are “linked”. Setting time1[T1] = 0; will also reset the value of time10[T1] and time100[T1]. The value returned is a signed integer, so each array will meet its upper bounds at a value of 32,768 ticks.
|
| Parameter
|
Explanation
|
Data Type
|
| timer
|
A timer to use.
|
TTimers
|
Timers:
|
int valTime1, valTime10, valTime100; // create three integers to read the value of the timer
valTime1 = time1[T1]; //Gets the value of Timer T1 in 1ms increments and stores it in a variable
valTime10 = time10[T1]; //Gets the value of Timer T1 in 10ms increments and stores it in a variable
valTime100 = time100[T1]; //Gets the value of Timer T1 in 100ms increments and stores it in a variable
|
|
| long time10[TTimers timer]
|
| (long) This array holds the current value of the respective timers. Each of the timer values can be retrieved in units of 1, 10 and 100 milliseconds depending on which array is used. For example, time1[T1] retrieves the value of timer T1 in units of 1-msec and time10[T1] retrieves the value using a 10-msec tick. And time100[T1] retrieves the value using 100-msec tick. Note that the arrays are “linked”. Setting time1[T1] = 0; will also reset the value of time10[T1] and time100[T1]. The value returned is a signed integer, so each array will meet its upper bounds at a value of 32,768 ticks.
|
| Parameter
|
Explanation
|
Data Type
|
| timer
|
A timer to use.
|
TTimers
|
Timers:
|
int valTime1, valTime10, valTime100; // create three integers to read the value of the timer
valTime1 = time1[T1]; //Gets the value of Timer T1 in 1ms increments and stores it in a variable
valTime10 = time10[T1]; //Gets the value of Timer T1 in 10ms increments and stores it in a variable
valTime100 = time100[T1]; //Gets the value of Timer T1 in 100ms increments and stores it in a variable
|
|
| long time100[TTimers timer]
|
| (long) This array holds the current value of the respective timers. Each of the timer values can be retrieved in units of 1, 10 and 100 milliseconds depending on which array is used. For example, time1[T1] retrieves the value of timer T1 in units of 1-msec and time10[T1] retrieves the value using a 10-msec tick. And time100[T1] retrieves the value using 100-msec tick. Note that the arrays are “linked”. Setting time1[T1] = 0; will also reset the value of time10[T1] and time100[T1]. The value returned is a signed integer, so each array will meet its upper bounds at a value of 32,768 ticks.
|
| Parameter
|
Explanation
|
Data Type
|
| timer
|
A timer to use.
|
TTimers
|
Timers:
|
int valTime1, valTime10, valTime100; // create three integers to read the value of the timer
valTime1 = time1[T1]; //Gets the value of Timer T1 in 1ms increments and stores it in a variable
valTime10 = time10[T1]; //Gets the value of Timer T1 in 10ms increments and stores it in a variable
valTime100 = time100[T1]; //Gets the value of Timer T1 in 100ms increments and stores it in a variable
|
|