VEXcode IQ C++ Unofficial documentation for version 3.0.4.1
Loading...
Searching...
No Matches
vex_timer.h
Go to the documentation of this file.
1/*----------------------------------------------------------------------------*/
2/* */
3/* Copyright (c) Innovation First 2017-2019, All rights reserved. */
4/* */
5/* Module: vex_timer.h */
6/* Author: James Pearman */
7/* Created: 24 May 2018 */
8/* */
9/* Revisions: */
10/* V1.00 TBD - Initial release */
11/* */
12/*----------------------------------------------------------------------------*/
13
14#ifndef VEX_TIMER_CLASS_H
15#define VEX_TIMER_CLASS_H
16
17/*-----------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace vex {
27 class timer {
28 private:
29 uint32_t _offset;
30 uint32_t _initial;
31
32 public:
33 timer();
34 ~timer();
35
36 // Assignment
37 void operator=( uint32_t value );
38
39 // Get value
40 operator uint32_t() const;
41
46 uint32_t time() const;
47
53 double time( timeUnits units ) const;
54
59 double value() const;
60
64 void clear();
65
69 void reset();
70
75 static uint32_t system();
76
82 static void event( void(* callback)(void *), uint32_t value );
83
89 static void event( void(* callback)(void), uint32_t value );
90 };
91}
92
93#endif // VEX_TIMER_CLASS_H
Use the timer class to create timers for your program.
Definition vex_timer.h:27
double value() const
Gets the current value of the timer in seconds.
void reset()
Sets the current value of the timer to 0.
static uint32_t system()
Gets the current value of the system timer in mS.
static void event(void(*callback)(void *), uint32_t value)
Sets a callback that will be called in the future.
static void event(void(*callback)(void), uint32_t value)
Sets a callback that will be called in the future.
void clear()
Sets the current value of the timer to 0.
uint32_t time() const
Gets the current value of the timer in mS.
double time(timeUnits units) const
Gets the current value of the timer in specified units.
Bumper switch device class
Definition vex_brain.h:24