WPILibC++  unspecified
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  virtual ~Accelerometer() = default;
18 
19  enum Range { kRange_2G = 0, kRange_4G = 1, kRange_8G = 2, kRange_16G = 3 };
20 
28  virtual void SetRange(Range range) = 0;
29 
35  virtual double GetX() = 0;
36 
42  virtual double GetY() = 0;
43 
49  virtual double GetZ() = 0;
50 };
51 
52 } // namespace frc
Definition: RobotController.cpp:14
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