Rover API Documentation
rover_gy521.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 FH Dortmund and others
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Description:
9  * RoverGY521 API - Interfaces for Rover GY521 accelerometer application development
10  * Header file
11  *
12  * Contributors:
13  * M.Ozcelikors <mozcelikors@gmail.com>, created RoverGY521 class 04.12.2017
14  *
15  * Disclaimer:
16  * Adapted from https://github.com/OmarAflak/GY-521-Raspberry-Pi-C-/
17  *
18  */
19 
20 #ifndef ROVERAPI_ROVER_GY521_HPP_
21 #define ROVERAPI_ROVER_GY521_HPP_
22 
24 
25 #include <stdint.h>
26 #include <stdio.h>
27 #include <unistd.h>
28 
29 namespace rover
30 {
34  class RoverGY521 : public RoverSensor
35  {
36  private:
41 
46 
47 
48  public:
52  explicit RoverGY521 ();
53 
58  explicit RoverGY521 (const int custom_i2c_address);
59 
63  ~RoverGY521();
64 
69  void initialize (void);
70 
74  float read (void);
75 
80  int8_t getGyroX (void);
81 
86  int8_t getGyroY (void);
87 
92  int8_t getGyroZ (void);
93 
98  int8_t getAccelX (void);
99 
104  int8_t getAccelY (void);
105 
110  int8_t getAccelZ (void);
111 
116  float getAngleX (void);
117 
122  float getAngleY (void);
123 
128  float getAngleZ (void);
129 
130  };
131 }
132 
133 
134 
135 
136 #endif /* ROVERAPI_ROVER_GY521_HPP_ */
RoverGY521()
Default Constructor for the RoverGY521 class.
Definition: rover_gy521.cpp:39
RoverSensor class is an abstract class to define interface between common sensors used in the rover...
Definition: rover_sensor.hpp:48
float read(void)
Non implemented function.
Definition: rover_gy521.cpp:227
int8_t getAccelZ(void)
Returns accelerometer output for Z-axis.
Definition: rover_gy521.cpp:151
int ROVERGY521_SETUP_
Flag to hold if RoverGY521 is initialized or not.
Definition: rover_gy521.hpp:40
int8_t getAccelY(void)
Returns accelerometer output for Y-axis.
Definition: rover_gy521.cpp:135
float getAngleZ(void)
Returns angle in the Z-axis.
Definition: rover_gy521.cpp:207
void initialize(void)
Function to setup RoverGY521 sensor.
Definition: rover_gy521.cpp:55
int8_t getAccelX(void)
Returns accelerometer output for X-axis.
Definition: rover_gy521.cpp:119
rover Namespace contains classes to manage Rover sensors, gpio, buzzer, buttons, driving, utilities, and cloud.
Definition: rover_api.hpp:293
int i2CAddress
I2C address for overriding.
Definition: rover_gy521.hpp:45
int8_t getGyroZ(void)
Returns gyroscope output for Z-axis.
Definition: rover_gy521.cpp:103
float getAngleY(void)
Returns angle in the Y-axis.
Definition: rover_gy521.cpp:187
float getAngleX(void)
Returns angle in the X-axis.
Definition: rover_gy521.cpp:167
~RoverGY521()
Destructor for the RoverGY521 class.
Definition: rover_gy521.cpp:53
int8_t getGyroX(void)
Returns gyroscope output for X-axis.
Definition: rover_gy521.cpp:71
RoverGY521 is a class that is inherited from RoverSensor abstract class. RoverGY521 class contains me...
Definition: rover_gy521.hpp:34
int8_t getGyroY(void)
Returns gyroscope output for Y-axis.
Definition: rover_gy521.cpp:87