Rover API Documentation
rover_button.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  * RoverButton API - Interfaces for Rover button application development - Header file
10  *
11  * Contributors:
12  * M.Ozcelikors <mozcelikors@gmail.com>, created C++API 05.12.2017
13  *
14  */
15 
16 #ifndef ROVERAPI_ROVER_BUTTON_HPP_
17 #define ROVERAPI_ROVER_BUTTON_HPP_
18 
19 
20 #include <roverapi/rover_gpio.hpp>
21 
22 namespace rover
23 {
24 
31 
35  class RoverButton : public RoverGpio
36  {
37  private:
41  static const int SHUTDOWN_BUTTON_PIN = 29; //BCM-21, wiringpi 29
42 
46  static const int USER_BUTTON_PIN = 27; //BCM-16, wiringpi 27
47 
51  int buttonPin;
52 
57 
62 
63  public:
67  RoverButton (const RoverButtonType_t button_type);
68 
73  void initialize (void);
74 
79  int readButton (void);
80 
86  void setButtonPin (const int button_pin);
87  };
88 }
89 
90 
91 #endif /* ROVERAPI_ROVER_BUTTON_HPP_ */
void setButtonPin(const int button_pin)
Overrides the default button pin used in wiringPi format.
Definition: rover_button.cpp:75
int buttonPin
Button pin.
Definition: rover_button.hpp:51
int readButton(void)
Reads the digital value of the a button.
Definition: rover_button.cpp:62
static const int USER_BUTTON_PIN
User button pin in wiringPi format.
Definition: rover_button.hpp:46
RoverButtonType_t
Button type.
Definition: rover_button.hpp:28
void initialize(void)
RoverButton initializer.
Definition: rover_button.cpp:41
rover Namespace contains classes to manage Rover sensors, gpio, buzzer, buttons, driving, utilities, and cloud.
Definition: rover_api.hpp:293
int ROVERBUTTON_INIT_
Flag to hold if RoverButton is set up.
Definition: rover_button.hpp:61
RoverButton class contains member functions to access Shutdown button, User button, and customly installed buttons on the rover.
Definition: rover_button.hpp:35
static const int SHUTDOWN_BUTTON_PIN
Shutdown button pin in wiringPi format.
Definition: rover_button.hpp:41
Definition: rover_button.hpp:28
Definition: rover_button.hpp:29
RoverButton(const RoverButtonType_t button_type)
(assigning) Constructor for RoverButton
Definition: rover_button.cpp:21
RoverGpio class provides the member functions related to basic GPIO operations. This class wraps wiri...
Definition: rover_gpio.hpp:24
RoverButtonType_t buttonType
Button type.
Definition: rover_button.hpp:56
Definition: rover_button.hpp:30