WPILibC++  2019.1.1-beta-2-1-g9bc998f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Accelerometer.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2014-2018 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 namespace frc {
11 
16  public:
17  Accelerometer() = default;
18  virtual ~Accelerometer() = default;
19 
20  Accelerometer(Accelerometer&&) = default;
21  Accelerometer& operator=(Accelerometer&&) = default;
22 
23  enum Range { kRange_2G = 0, kRange_4G = 1, kRange_8G = 2, kRange_16G = 3 };
24 
32  virtual void SetRange(Range range) = 0;
33 
39  virtual double GetX() = 0;
40 
46  virtual double GetY() = 0;
47 
53  virtual double GetZ() = 0;
54 };
55 
56 } // namespace frc
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
virtual double GetX()=0
Common interface for getting the x axis acceleration.
virtual double GetZ()=0
Common interface for getting the z axis acceleration.
virtual double GetY()=0
Common interface for getting the y axis acceleration.
virtual void SetRange(Range range)=0
Common interface for setting the measuring range of an accelerometer.
Interface for 3-axis accelerometers.
Definition: Accelerometer.h:15