embedded system library for e-puck  1.0.1
A redesigned API library for the e-puck robot platform
 All Data Structures Files Functions Variables Enumerations Enumerator Modules Pages
Files
Timer

providing timing related functionalities More...

Files

file  el_timer.h
 

Detailed Description

providing timing related functionalities

Introduction

Timer is the object associated with many features involving timing.

Example Usage

Example 3 in the repository demonstrates how to use timers to measure the fps of the camera. Here, more examples of using timer are introduced.

Note: In the following examples, the code section is within a process.

Communication with a Time Window

...
el_bool IsInDebugMode;
el_handle T;
char c;
elu_println("<send 'g' in 5 sec to enter debug mode>");
IsInDebugMode = false;
while( el_timer_get_rounds(T) == 0 ){
if( el_uart_get_char_counter(EL_UART_1) > 0 ){
c = el_uart_get_char(EL_UART_1);
if( c == 'g' ){
IsInDebugMode = true;
break;
}
}
}
T = NULL;
if(IsInDebugMode){
elu_println("proceed in debug mode");
}else{
elu_println("proceed in normal mode");
}
/*
In run time, if nothing is sent in 5 sec, the program reaches here with
IsInDebugMode being false. Otherwise, IsInDebugMode would be true.
*/
...