Changes to existing API classes

Signed-off-by: Mustafa Ozcelikors <mozcelikors@gmail.com>
diff --git a/rover/include/roverapi/rover_api.hpp b/rover/include/roverapi/rover_api.hpp
index c65fc28..26b93de 100644
--- a/rover/include/roverapi/rover_api.hpp
+++ b/rover/include/roverapi/rover_api.hpp
@@ -6,7 +6,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Description:
- *    Rover API - Interfaces for Rover application development - Header file
+ *    Rover API - Interfaces for basic Rover application development - Header file
  *
  * Contributors:
  *    M.Ozcelikors <mozcelikors@gmail.com>, created API 17.11.2017
@@ -18,12 +18,6 @@
 
 #include <stdint.h>
 
-#include <roverapi/rover_display.hpp>
-#include <roverapi/rover_driving.hpp>
-#include <roverapi/rover_gpio.hpp>
-#include <roverapi/rover_sensors.hpp>
-#include <roverapi/rover_utils.hpp>
-#include <roverapi/rover_cloud.hpp>
 
 /**
 \mainpage Rover API Main Page
@@ -36,42 +30,69 @@
 
 Roverapp builds and contains the **Rover API**, which is able to handle subset of its functionality. Example functionality covered in **Rover API** is given below:
 
-\li **RoverBase** class is the main class used for instantiating rover objects.
-Each RoverBase object has private member functions referencing to other API classes exclusive to one RoverBase object.
-Therefore, using one RoverBase class, other classes can be accessed, and operations such as initialization,
-shutting down could be performed.
+\li **RoverBase** RoverBase class provides basic rover functions such as initialization, sleeping, and shutting down.
 \li **RoverCloud** contains the member functions to connect and send data to Eclipse Hono instance using several parameters such as host name, port, tenant name, user name, and password. This class wraps hono_interaction library for Rover-specific interactions.
 \li **RoverDisplay** contains the member functions to control OLED display on the Rover. This class is a wrapper API for Adafruit_GFX and Adafruit_SSD1306 libraries.
 \li **RoverDriving** contains the member functions to drive the rover using its motors.
-\li **RoverGpio** class provides the member functions related to embedded buzzer, user button, and shutdown button on the rover.
-\li **RoverSensors** class contains member functions to setup and read from embedded sensors from rover's RoverSenseLayer sensor layer.
+\li **RoverGpio** class provides the member functions related to low-level pin driving. This class wraps wiringPi library and is inherited by RoverButton and RoverBuzzer classes.
+\li **RoverBuzzer** class provides the member functions related to embedded buzzer on the rover.
+\li **RoverButton** class contains member functions to access Shutdown button, User button, and customly installed buttons on the rover.
 \li **RoverUtils** contains member functions to retrieve connectivity status and core utilization of the rover. This class wraps status_library lib, developed for the rover-app.
+\li **RoverSensors** is a pure abstract class defining the interface between sensor classes of the rover.
+
+\li **RoverDHT22** is a class that is inherited from RoverSensor abstract class. RoverDHT22 class contains member functions and variables to set up and read from DHT22 temperature and humidity sensor that is embedded on the rover.
+\li **RoverGrooveUltrasonic** is a class that is inherited from RoverSensor abstract class. RoverGrooveUltrasonic class contains member functions and variables to set up and read from Groove ultrasonic sensors that are embedded on the rover.
+\li **RoverHCSR04** is a class that is inherited from RoverSensor abstract class. RoverHCSR04 class contains member functions and variables to set up and read from HCSR-04 ultrasonic sensors that are embedded on the rover.
+\li **RoverInfraredSensor** is a class that is inherited from RoverSensor abstract class. RoverInfraredSensor class contains member functions and variables to set up and read from SHARP infrared sensors that are embedded on the rover.
+\li **RoverGY521** is a class that is inherited from RoverSensor abstract class. RoverGY521 class contains member functions and variables to set up and read from GY521 accelerometer that is embedded on the rover.
+\li **RoverHMC5883L** is a class that is inherited from RoverSensor abstract class. RoverHMC5883L class contains member functions and variables to set up and read from HMC5883L bearing sensor that is embedded on the rover.
+\li **RoverQMC5883L** is a class that is inherited from RoverSensor abstract class. RoverQMC5883L class contains member functions and variables to set up and read from QMC5883L bearing sensor that is embedded on the rover.
 
 \image html ./images/rover2.jpg
 
+
+\section overview1 UML Diagram Overview
+
+\image html ./images/RoverAPI_Overview.jpg
+Updated: 05.12.2017
+
 \section example_usage Rover API Example Usage
 The following is an example C++ application using some of the Rover API functions:
 
 \code{.cpp}
+//Basis Include
 #include <roverapi/rover_api.hpp>
+//Other Includes
+#include <roverapi/rover_cloud.hpp>
+#include <roverapi/rover_dht22.hpp>
+#include <roverapi/rover_display.hpp>
+#include <roverapi/rover_driving.hpp>
+#include <roverapi/rover_buzzer.hpp>
+#include <roverapi/rover_button.hpp>
+#include <roverapi/rover_grooveultrasonic.hpp>
+#include <roverapi/rover_gy521.hpp>
+#include <roverapi/rover_hcsr04.hpp>
+#include <roverapi/rover_hmc5883l.hpp>
+#include <roverapi/rover_infraredsensor.hpp>
+#include <roverapi/rover_qmc5883l.hpp>
+#include <roverapi/rover_utils.hpp>
 
 using namespace rover;
 
 int main (void)
 {
-	RoverBase r;
-
-	// Initialize all components of the rover
-	r.initialize();
-    // or use r.initializeWiringPi(), r.initializeRoverSensors(), r.initializeRoverDisplay(), r.initializeRoverDriving(), r.initializeRoverGpio() to initialize individual components
+	//This initialization is a one time only must-call before every rover application, initializes low-level GPIO driver
+	RoverBase r_base = RoverBase();
+	r_base.initialize();
 
 	// Set-up cloud instance and register your device
-	RoverCloud r_cloud = r.inRoverCloud();
+	RoverCloud r_cloud = RoverCloud("myhost", 8080, 28080, "DEFAULT_TENANT");
 
+	// To override the initial RoverCloud set-up
 	r_cloud.setHono("localhost", 8080, "DEFAULT_TENANT");
-
 	r_cloud.setRegistrationPort(28080);
 
+	// Register a Device
 	if (r_cloud.registerDevice("4711") == 1)
 	{
 		printf ("Registered device to Hono cloud using REST API successfully..\n");
@@ -84,42 +105,83 @@
 	}
 
 	// Driving with rover
-	r.inRoverDriving().setSpeed(r.inRoverDriving().HIGHEST_SPEED);
-	r.inRoverDriving().goForward();
-	r.sleep (500); // Sleep for some time in milliseconds
-	r.inRoverDriving().turnRight();
-	r.sleep (500); // Sleep for some time in milliseconds
-	r.inRoverDriving().stopRover();
+	RoverDriving r_driving = RoverDriving();
+	r_driving.initialize();
 
+	r_driving.setSpeed(HIGHEST_SPEED);
+	r_driving.goForward();
+	r_base.sleep (500); // Sleep for some time in milliseconds
+	r_driving.turnRight();
+	r_base.sleep (500); // Sleep for some time in milliseconds
+	r_driving.stopRover();
 
-	// Accessing sensors with rover
-	RoverSensors r_sensors = r.inRoverSensors();
+	// Instantiation of Rover sensors
+	RoverHCSR04 r_front = RoverHCSR04(ROVER_FRONT);
+	RoverHCSR04 r_rear = RoverHCSR04(ROVER_REAR);
+	// or  RoverGrooveUltrasonic r_rear = RoverGrooveUltrasonic(ROVER_REAR);
+	RoverInfraredSensor r_infrared0 = RoverInfraredSensor(ROVER_REAR_RIGHT);
+	RoverInfraredSensor r_infrared1 = RoverInfraredSensor(ROVER_REAR_LEFT);
+	RoverInfraredSensor r_infrared2 = RoverInfraredSensor(ROVER_FRONT_RIGHT);
+	RoverInfraredSensor r_infrared3 = RoverInfraredSensor(ROVER_FRONT_LEFT);
+	RoverDHT22 r_dht22 = RoverDHT22();
+	RoverHMC5883L r_hmc = RoverHMC5883L();
+	// or RoverQMC5883L r_qmc = RoverQMC5883L();
 
-	printf ("Ultrasonic = [%d %d]\n",	r_sensors.readHCSR04UltrasonicSensor(r_sensors.ROVER_FRONT),
-										r_sensors.readHCSR04UltrasonicSensor(r_sensors.ROVER_REAR));
-	printf ("Infrared = [%f %f %f %f]\n", 	r_sensors.readInfraredSensor(r_sensors.ROVER_FRONT_LEFT),
-											r_sensors.readInfraredSensor(r_sensors.ROVER_FRONT_RIGHT),
-											r_sensors.readInfraredSensor(r_sensors.ROVER_REAR_LEFT),
-											r_sensors.readInfraredSensor(r_sensors.ROVER_REAR_RIGHT));
-	printf ("Temperature = %f\n",	r_sensors.readTemperature());
-	printf ("Humidity = %f\n",		r_sensors.readHumidity());
-	printf ("Bearing = %f\n",		r_sensors.readBearingHMC5883L());
+	// Set up ultrasonic sensors
+	r_front.initialize();
+	r_rear.initialize();
+
+	// Set up infrared sensors
+	r_infrared0.initialize();
+	r_infrared1.initialize();
+	r_infrared2.initialize();
+	r_infrared3.initialize();
+
+	// Set up DHT22 temperature and humidity sensor
+	r_dht22.initialize();
+
+	// Set up HMC5883L or QMC5883L compass sensor
+	r_hmc.initialize();
+	//r_qmc.initialize();
+
+	printf ("Ultrasonic = [%f %f]\n",	r_front.read(),
+										r_rear.read());
+	printf ("Infrared = [%f %f %f %f]\n", 	r_infrared0.read(),
+											r_infrared1.read(),
+											r_infrared2.read(),
+											r_infrared3.read());
+	printf ("Temperature = %f\n",	r_dht22.readTemperature());
+	printf ("Humidity = %f\n",		r_dht22.readHumidity());
+	printf ("Bearing with HMC5883L = %f\n",		r_hmc.read());
+	// or printf ("Bearing with QMC5883L = %f\n",		r_qmc.read());
+
+	// Instantiate objects to access buzzer and buttons on the rover
+	RoverButton user_b = RoverButton (USER_BUTTON);
+	RoverButton shutdown_b = RoverButton (SHUTDOWN_BUTTON);
+	RoverBuzzer buzzer = RoverBuzzer();
+
+	user_b.initialize();
+	shutdown_b.initialize();
+	buzzer.initialize();
 
 	// Checking if a button is pressed (LOW) and playing a tone with buzzer
-	if (r.inRoverGpio().readUserButton() == r.inRoverGpio().LO)
+	if (user_b.readButton() == user_b.LO)
 	{
-		r.inRoverGpio().setBuzzerFrequency(400); //in Hz
-		r.inRoverGpio().setBuzzerOn();
-		r.sleep(1000);
+		buzzer.setBuzzerFrequency(400); //in Hz
+		buzzer.setBuzzerOn();
+		r_base.sleep(1000);
 	}
-	r.inRoverGpio.setBuzzerOff();
+	buzzer.setBuzzerOff();
+
+	// Instantiate a RoverUtils object to access member functions that deals with status and performance tasks
+	RoverUtils r_utils = RoverUtils(); //RoverUtils does not need to be initialized
 
 	// Print core utilization from the rover's OS
-	float *util = r.inRoverUtils.getCoreUtilization();
+	float *util = r_utils.getCoreUtilization();
 	printf ("Utilization = [%f %f %f %f]\n", util);
 
 	// Use the OLED display on the rover
-	RoverDisplay my_display = r.inRoverDisplay();
+	RoverDisplay my_display = RoverDisplay();
 
 	// Prepare display contents
 	my_display.clearDisplay();
@@ -133,7 +195,7 @@
 	my_display.setTextColor(my_display.WHITE_COLOR);
 
 	// Check if internet is connected
-	if (r.inRoverUtils().getInternetStatus() == 1)
+	if (r_utils.getInternetStatus() == 1)
 	{
 		my_display.setCursor(50,32);
 		my_display.print("ON");
@@ -148,10 +210,10 @@
 	my_display.display();
 
 	// Sleep a bit
-	r.sleep(5000);
+	r_base.sleep(5000);
 
 	// Shutdown the rover OS and abort the application
-	r.shutdown();
+	r_base.shutdown();
 
 	return 1;
 }
@@ -165,75 +227,18 @@
 
 */
 
+
 /**
-  *   @brief  rover Namespace contains classes to manage Rover sensors, gpio, driving, utilities, and cloud.
+  *   @brief  rover Namespace contains classes to manage Rover sensors, gpio, buzzer, buttons, driving, utilities, and cloud.
   */
 namespace rover
 {
+
 	/**
-	  *   @brief  RoverBase class is the main class used for instantiating rover objects.
-	  *   Each RoverBase object has private member functions referencing to other API classes exclusive to one RoverBase object.
-	  *   Therefore, using one RoverBase class, other classes can be accessed, and operations such as initialization,
-	  *   shutting down could be performed.
+	  *   @brief  RoverBase class provides basic rover functions such as initialization, sleeping, and shutting down.
 	  */
 	class RoverBase
 	{
-		private:
-			/**
-			 * @brief Private RoverCloud instance that is accessed from RoverBase
-			 */
-			RoverCloud myRoverCloud;
-
-			/**
-			 * @brief Private RoverDisplay instance that is accessed from RoverBase
-			 */
-			RoverDisplay myRoverDisplay;
-
-			/**
-			 * @brief Private RoverDriving instance that is accessed from RoverBase
-			 */
-			RoverDriving myRoverDriving;
-
-			/**
-			 * @brief Private RoverGpio instance that is accessed from RoverBase
-			 */
-			RoverGpio myRoverGpio;
-
-			/**
-			 * @brief Private RoverSensors instance that is accessed from RoverBase
-			 */
-			RoverSensors myRoverSensors;
-
-			/**
-			 * @brief Private RoverUtils instance that is accessed from RoverBase
-			 */
-			RoverUtils myRoverUtils;
-
-			/**
-			 * @brief Flag for indicating whether private RoverGpio object initialized or not.
-			 */
-			int ROVER_GPIO_INIT_;
-
-			/**
-			 * @brief Flag for indicating whether private RoverSensors object initialized or not.
-			 */
-			int ROVER_SENSORS_INIT_;
-
-			/**
-			 * @brief Flag for indicating whether private RoverDisplay object initialized or not.
-			 */
-			int ROVER_DISPLAY_INIT_;
-
-			/**
-			 * @brief Flag for indicating whether private RoverDriving object initialized or not.
-			 */
-			int ROVER_DRIVING_INIT_;
-
-			/**
-			 * @brief Flag for indicating whether wiringPi library initialized or not.
-			 */
-			int WIRINGPI_INIT_;
-
 
 		public:
 			/**
@@ -247,15 +252,14 @@
 			virtual ~RoverBase();
 
 			/**
-			  *   @brief  Initializes the all classes, sensors, libraries for the Rover.
+			  *   @brief  Initializes the wiringPi library
 			  *   @return void
 			  *
-			  *   \warning This function can only be used once in Rover's Raspberry Pi. You can still use a second RoverBase object and configure that object. However, initializing in the low-level sense causes problems.
+			  *   \warning This function should be called once per application.
 			  *   \code{.cpp}
-			  *   RoverBase r;
-			  *   RoverBase x;
-			  *   r.initialize();
-			  *   x.initialize(); //^^^THIS IS NOT VALID AND WILL PRODUCE ERRORS
+			  *   RoverBase r_base = RoverBase();
+			  *   r_base.initialize();
+			  *   //.. Here comes all the rover objects and apps..
 			  *   \endcode
 			  */
 			void initialize (void);
@@ -271,73 +275,19 @@
 			 * @param period_ms Period to sleep in milliseconds
 			 * @return void
 			 */
-			void sleep (unsigned int period_ms);
+			void sleep (const unsigned int period_ms);
 
-			/**
-			 * @brief Public function to access private RoverCloud instance.
-			 * @return RoverCloud instance
-			 */
-			rover::RoverCloud& inRoverCloud (void);
-
-			/**
-			 * @brief Public function to access private RoverDisplay instance.
-			 * @return RoverDisplay instance
-			 */
-			rover::RoverDisplay& inRoverDisplay (void);
-
-			/**
-			 * @brief Public function to access private RoverDriving instance.
-			 * @return RoverDriving instance
-			 */
-			rover::RoverDriving& inRoverDriving (void);
-
-			/**
-			 * @brief Public function to access private RoverGpio instance.
-			 * @return RoverGpio instance
-			 */
-			rover::RoverGpio& inRoverGpio (void);
-
-			/**
-			 * @brief Public function to access private RoverSensors instance.
-			 * @return RoverSensors instance
-			 */
-			rover::RoverSensors& inRoverSensors (void);
-
-			/**
-			 * @brief Public function to access private RoverUtils instance.
-			 * @return RoverUtils instance
-			 */
-			rover::RoverUtils& inRoverUtils (void);
-
-			/**
-			 * @brief Initializes private RoverDriving object instance.
-			 * @return void
-			 */
-			void initializeRoverDriving (void);
-
-			/**
-			 * @brief Initializes private RoverGpio object instance.
-			 * @return void
-			 */
-			void initializeRoverGpio (void);
-
-			/**
-			 * @brief Initializes private RoverDisplay object instance.
-			 * @return void
-			 */
-			void initializeRoverDisplay (void);
-
-			/**
-			 * @brief Initializes private RoverSensors object instance.
-			 * @return void
-			 */
-			void initializeRoverSensors (void);
-
+		private:
 			/**
 			  *   @brief  Initializes wiringPi library to access GPIO of Rover. This function should be called in every program run and must only be called once.
 			  *   @return void
 			  */
 			void initializeWiringPi (void);
+
+			/**
+			 * @brief Flag for indicating whether wiringPi library initialized or not.
+			 */
+			int WIRINGPI_INIT_;
 	};
 }
 
diff --git a/rover/include/roverapi/rover_cloud.hpp b/rover/include/roverapi/rover_cloud.hpp
index 8e985b4..a835b98 100644
--- a/rover/include/roverapi/rover_cloud.hpp
+++ b/rover/include/roverapi/rover_cloud.hpp
@@ -28,48 +28,57 @@
 			/**
 			 * @brief Host name used for connecting to the Eclipse Hono using REST API
 			 */
-			char * HOST_NAME;
+			mutable char * HOST_NAME;
 			/**
 			 * @brief Port used for connecting to the Eclipse Hono using REST API
 			 */
-			int PORT;
+			mutable int PORT;
 			/**
 			 * @brief Port used for registering a device to the Eclipse Hono using REST API
 			 */
-			int REGISTRATION_PORT;
+			mutable int REGISTRATION_PORT;
 			/**
 			 * @brief Tenant name used for connecting to the Eclipse Hono using REST API
 			 */
-			char * TENANT_NAME;
+			mutable char * TENANT_NAME;
 
 			/**
 			 * @brief Checks private attributes and gives an error message and returns 0 if they're invalid.
 			 */
-			int attributeErrorCheck (void);
+			int attributeErrorCheck (void) const;
 
 		public:
 			/**
-			 * @brief Constructor for the RoverCloud
+			 * @brief (default) Constructor for the RoverCloud
 			 */
 			explicit RoverCloud();
 
 			/**
+			 * @brief (assigning) Constructor for the RoverCloud
+			 * @param host_name
+			 * @param registration_port
+			 * @param port
+			 * @param tenant
+			 */
+			explicit RoverCloud(char * host_name, const int port, const int registration_port, char * tenant_name);
+
+			/**
 			 * @brief Sets private attribute HOST_NAME
 			 * @param host_name
 			 */
-			void setHostName (char * host_name);
+			void setHostName (char * host_name) const;
 
 			/**
 			 * @brief Sets private attribute PORT
 			 * @param port
 			 */
-			void setPort (int port);
+			void setPort (const int port) const;
 
 			/**
 			 * @brief Sets private attribute TENANT_NAME
 			 * @param tenant
 			 */
-			void setTenantName (char * tenant);
+			void setTenantName (char * tenant) const;
 
 			/**
 			 * @brief Sets up a hono connection using host name, port, and tenant name
@@ -77,35 +86,35 @@
 			 * @param port
 			 * @param tenant
 			 */
-			void setHono (char * host_name, int port, char * tenant);
+			void setHono (char * host_name, const int port, char * tenant) const;
 
 			/**
 			 * @brief Retrieves private attribute HOST_NAME
 			 */
-			char * getHostName (void);
+			char * getHostName (void) const;
 
 			/**
 			 * @brief Retrieves private attribute PORT
 			 */
-			int getPort (void);
+			int getPort (void) const;
 
 			/**
 			 * @brief Retrieves private attribute TENANT_NAME
 			 */
-			char * getTenantName (void);
+			char * getTenantName (void) const;
 
 			/**
 			 * @brief Sets the default REGISTRATION_PORT variable
 			 * @param port (int) to be set as REGISTRATION_PORT
 			 * @return void
 			 */
-			void setRegistrationPort (int port);
+			void setRegistrationPort (const int port) const;
 
 			/**
 			 * @brief Retrieves private attribute REGISTRATION_PORT
 			 * @return Private attribute REGISTRATION_PORT
 			 */
-			int getRegistrationPort (void);
+			int getRegistrationPort (void) const;
 
 			/**
 			 * @brief Constructs curl command to register a device to Hono instance given device ID using REST API
diff --git a/rover/include/roverapi/rover_display.hpp b/rover/include/roverapi/rover_display.hpp
index 6b73fed..0bc9aba 100644
--- a/rover/include/roverapi/rover_display.hpp
+++ b/rover/include/roverapi/rover_display.hpp
@@ -62,7 +62,13 @@
 			 */
 			Adafruit_SSD1306 my_display;
 
+			/**
+			 * @brief Flag to hold if RoverDisplay is initialized.
+			 */
+			int ROVER_DISPLAY_INIT_;
+
 		public:
+
 			/**
 			 * @brief Static definition to indicate BLACK color
 			 */
@@ -74,6 +80,11 @@
 			static const int WHITE_COLOR = 1;
 
 			/**
+			 * @brief (Default) Constructor for RoverDisplay class
+			 */
+			RoverDisplay();
+
+			/**
 			 * @brief Initializes the OLED display of the rover
 			 * @return void
 			 */
diff --git a/rover/include/roverapi/rover_driving.hpp b/rover/include/roverapi/rover_driving.hpp
index 0a21f9e..48c859e 100644
--- a/rover/include/roverapi/rover_driving.hpp
+++ b/rover/include/roverapi/rover_driving.hpp
@@ -18,6 +18,22 @@
 
 namespace rover
 {
+	/* Rover driving speeds */
+	/**
+	 * @brief Static definition to hold lowest driving speed for rover.
+	 */
+	static const int LOWEST_SPEED = 360;
+
+	/**
+	 * @brief Static definition to hold highest driving speed for rover.
+	 */
+	static const int HIGHEST_SPEED = 480;
+
+	/**
+	 * @brief Static definition to hold stopping speed for rover.
+	 */
+	static const int STOPPING_SPEED = 0;
+
 	/**
 	 * @brief Contains the member functions to drive the rover using its motors.
 	 */
@@ -29,22 +45,12 @@
 			 */
 			int SPEED;
 
+			/**
+			 * @brief Flag to hold if RoverDriving is initialized
+			 */
+			int ROVERDRIVING_INIT_;
+
 		public:
-			/* Rover driving speeds */
-			/**
-			 * @brief Static definition to hold lowest driving speed for rover.
-			 */
-			static const int LOWEST_SPEED = 360;
-
-			/**
-			 * @brief Static definition to hold highest driving speed for rover.
-			 */
-			static const int HIGHEST_SPEED = 480;
-
-			/**
-			 * @brief Static definition to hold stopping speed for rover.
-			 */
-			static const int STOPPING_SPEED = 0;
 
 			/**
 			 * @brief Constructor for RoverDriving class.
@@ -52,7 +58,7 @@
 			explicit RoverDriving();
 
 			/**
-			 * @brief Initializes wiringPi library and Analog to Digital Converter to start driving the rover.
+			 * @brief Initializes RoverDriving features.
 			 */
 			void initialize();
 
@@ -64,7 +70,7 @@
 			/**
 			 * @brief Sets the speed. 360 -> Lowest speed (RoverDriving::LOWEST_SPEED), 480 -> Highest speed (RoverDriving::HIGHEST_SPEED)
 			 */
-			void setSpeed (int speed_setpoint);
+			void setSpeed (const int speed_setpoint);
 
 			/**
 			 * @brief Retrieves the current speed setpoint.
diff --git a/rover/include/roverapi/rover_gpio.hpp b/rover/include/roverapi/rover_gpio.hpp
index adc4577..bf4f97a 100644
--- a/rover/include/roverapi/rover_gpio.hpp
+++ b/rover/include/roverapi/rover_gpio.hpp
@@ -19,33 +19,10 @@
 namespace rover
 {
 	/**
-	 * @brief RoverGpio class provides the member functions related to embedded buzzer, user button, and shutdown button on the rover.
+	 * @brief RoverGpio class provides the member functions related to basic GPIO operations. This class wraps wiringPi library.
 	 */
 	class RoverGpio
 	{
-		private:
-			/* Pins */
-			/**
-			 * @brief Buzzer pin in wiringPi format
-			 */
-			static const int BUZZER_PIN = 28;			//BCM-20, wiringpi 28
-
-			/**
-			 * @brief Shutdown button pin in wiringPi format
-			 */
-			static const int SHUTDOWN_BUTTON_PIN = 29;	//BCM-21, wiringpi 29
-
-			/**
-			 * @brief User button pin in wiringPi format
-			 */
-			static const int USER_BUTTON_PIN = 27;		//BCM-16, wiringpi 27
-
-			/* Variable members */
-			/**
-			 * @brief Default buzzer frequency used by setBuzzerOn function.
-			 */
-			int BUZZER_FREQUENCY;
-
 		public:
 
 			/* Pin Modes */
@@ -101,61 +78,6 @@
 			 */
 			explicit RoverGpio();
 
-			/**
-			 * @brief Initializes the RoverGpio functionality: Buzzer and Buttons
-			 * @return void
-			 */
-			void initialize (void);
-
-			/**
-			 * @brief Sets the default buzzer frequency in Hz. Values between 0-1000 Hz are conventionally used for the buzzer frequency.
-			 * @param buzzer_freq Buzzer frequency to be set in Hz
-			 * @return void
-			 */
-			void setBuzzerFrequency (int buzzer_freq);
-
-			/**
-			 * @brief Retrieves the default buzzer frequency in Hz.
-			 * @return buzzer_freq Default buzzer frequency in Hz.
-			 */
-			int getBuzzerFrequency (void);
-
-			/**
-			 * @brief Plays the buzzer with the default frequency.
-			 * @return void
-			 */
-			void setBuzzerOn (void);
-
-			/**
-			 * @brief Turns off the buzzer.
-			 * @return void
-			 */
-			void setBuzzerOff (void);
-
-			/**
-			 * @brief Plays the buzzer with custom buzzer frequency.
-			 * @param buzzer_freq Buzzer frequency to be set in Hz
-			 * @return void
-			 */
-			void setBuzzerTone (int buzzer_freq);
-
-			/**
-			 * @brief Plays the shutdown tone.
-			 * @return void
-			 */
-			void shutdownTone (void);
-
-			/**
-			 * @brief Reads the digital value of the user button (USER_BUTTON).
-			 * @return user_button_val RoverGpio::LO (low) or RoverGpio::HI (high). Default is LOW and when pressed, user_button_val gives HIGH.
-			 */
-			int readUserButton (void);
-
-			/**
-			 * @brief Reads the digital value of the shutdown button (SHUTDOWN_BUTTON).
-			 * @return shutdown_button_val RoverGpio::LO (low) or RoverGpio::HI (high). Default is LOW and when pressed, shutdown_button_val gives HIGH.
-			 */
-			int readShutdownButton (void);
 
 			/**
 			 * @brief Wrapper function to wiringPi's digitalWrite function
@@ -163,14 +85,14 @@
 			 * @param value Digital value to be given as output to the pin. LOW -> 0 HIGH -> 1
 			 * @return void
 			 */
-			void wPiDigitalWrite (int pin, int value);
+			void wPiDigitalWrite (const int pin, const int value);
 
 			/**
 			 * @brief Wrapper function to wiringPi's digitalRead function.
 			 * @param pin Pin number (int) to be read from using wiringPi pin descriptions.
 			 * @return value Digital value read from the pin. LOW -> 0 HIGH -> 1
 			 */
-			int wPiDigitalRead (int pin);
+			int wPiDigitalRead (const int pin);
 
 			/**
 			 * @brief Wrapper function to wiringPi's pinMode function.
@@ -178,7 +100,29 @@
 			 * @param set_val Pin Mode to be set for the GPIO pin: RoverGpio::INPUT_, RoverGpio::OUTPUT_, RoverGpio::PWM_OUTPUT_, RoverGpio::GPIO_CLOCK_, RoverGpio::SOFT_PWM_OUTPUT_, RoverGpio::SOFT_TONE_OUTPUT_, RoverGpio::PWM_TONE_OUTPUT_
 			 * @return void
 			 */
-			void wPiPinMode (int pin, int set_val);
+			void wPiPinMode (const int pin, const int set_val);
+
+			/**
+			 * @brief Wrapper function to wiringPi's softToneCreate function. Sets up a pin to have PWM  soft tone output.
+			 * @param pin Pin number (int) to be set
+			 * @return void
+			 */
+			void wPiSoftToneCreate (const int pin);
+
+			/**
+			 * @brief Wrapper function to wiringPi's softToneWrite function. Sets up a pin to have PWM  soft tone output.
+			 * @param pin Pin number (int) to be set
+			 * @param tone Tone frequency to create in Hz
+			 * @return void
+			 */
+			void wPiSoftToneWrite (const int pin, const int tone);
+
+			/**
+			 * @brief Delay function. Blocks some time in milliseconds
+			 * @param period_ms Period in milliseconds
+			 * @return void
+			 */
+			void wPiDelay (const int period_ms);
 	};
 }
 
diff --git a/rover/src/roverapi/rover_api.cpp b/rover/src/roverapi/rover_api.cpp
index 8afc961..3425e1e 100644
--- a/rover/src/roverapi/rover_api.cpp
+++ b/rover/src/roverapi/rover_api.cpp
@@ -6,7 +6,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Description:
- *    Rover API - Interfaces for Rover application development
+ *    Rover API - Interfaces for basic Rover application development
  *
  * Contributors:
  *    M.Ozcelikors <mozcelikors@gmail.com>, created API 17.11.2017
@@ -19,20 +19,17 @@
 #include <roverapi/rover_cloud.hpp>
 #include <roverapi/rover_utils.hpp>
 #include <roverapi/rover_driving.hpp>
-#include <roverapi/rover_gpio.hpp>
+#include <roverapi/rover_buzzer.hpp>
 #include <roverapi/rover_display.hpp>
-#include <roverapi/rover_sensors.hpp>
+#include <roverapi/rover_sensor.hpp>
 
 /**
   *   @brief  Constructor for the RoverBase class
   */
 rover::RoverBase::RoverBase()
+:WIRINGPI_INIT_(0)
 {
-	this->WIRINGPI_INIT_ = 0;
-	this->ROVER_DISPLAY_INIT_ = 0;
-	this->ROVER_DRIVING_INIT_ = 0;
-	this->ROVER_GPIO_INIT_ = 0;
-	this->ROVER_SENSORS_INIT_ = 0;
+
 }
 
 /**
@@ -47,19 +44,15 @@
 void rover::RoverBase::initialize(void)
 {
 	this->initializeWiringPi();
-	this->initializeRoverDisplay();
-	this->initializeRoverDriving();
-	this->initializeRoverGpio();
-	this->initializeRoverSensors();
 }
 
-
 void rover::RoverBase::initializeWiringPi(void)
 {
 	/* wiringPi can only be called once per program, One solution: */
 	static class Once { public: Once(){
 		wiringPiSetup();
 		printf("wiringPi Setup Done..\n");
+		printf("RoverBase initialized..\n");
 	}} Once_;
 	this->WIRINGPI_INIT_ = 1;
 }
@@ -70,13 +63,13 @@
 	{
 		fprintf(stderr,"You havent initialized wiringPi library. Use RoverBase::initialize() !\n");
 	}
-	else if (this->ROVER_DISPLAY_INIT_ != 1)
-	{
-		fprintf(stderr,"You havent initialized RoverDisplay. Use RoverBase::initialize() !\n");
-	}
 	else
 	{
-		RoverDisplay my_display = this->inRoverDisplay();
+		RoverDisplay my_display = RoverDisplay();
+		RoverBuzzer r_buzzer = RoverBuzzer();
+		r_buzzer.initialize();
+
+		my_display.initialize();
 
 		/* Prepare "Shutting Down..." */
 		my_display.clearDisplay();
@@ -96,7 +89,7 @@
 		my_display.display();
 
 		/* Play the shutdown tone..*/
-		this->inRoverGpio().shutdownTone();
+		r_buzzer.shutdownTone();
 
 		/* Prepare "Shutting Down..." */
 		my_display.clearDisplay();
@@ -140,145 +133,15 @@
 	}
 }
 
-void rover::RoverBase::sleep (unsigned int period_ms)
+void rover::RoverBase::sleep (const unsigned int period_ms)
 {
 	if (this->WIRINGPI_INIT_ != 1)
 	{
 		fprintf(stderr,"You havent initialized wiringPi library. Use RoverBase::initialize() !\n");
 	}
-	else if (this->ROVER_DRIVING_INIT_ != 1)
-	{
-		fprintf(stderr,"You havent initialized RoverDriving. Use RoverBase::initialize() !\n");
-	}
 	else
 	{
 		delay (period_ms);
 	}
 }
 
-rover::RoverUtils& rover::RoverBase::inRoverUtils (void)
-{
-	return this->myRoverUtils;
-}
-
-rover::RoverCloud& rover::RoverBase::inRoverCloud (void)
-{
-	return this->myRoverCloud;
-}
-
-rover::RoverDriving& rover::RoverBase::inRoverDriving (void)
-{
-	if (this->WIRINGPI_INIT_ != 1)
-	{
-		fprintf(stderr,"You havent initialized wiringPi library. Use RoverBase::initialize() !\n");
-	}
-	else if (this->ROVER_DRIVING_INIT_ != 1)
-	{
-		fprintf(stderr,"You havent initialized RoverDriving. Use RoverBase::initialize() !\n");
-	}
-	else
-	{
-		return this->myRoverDriving;
-	}
-}
-
-rover::RoverGpio& rover::RoverBase::inRoverGpio (void)
-{
-	if (this->WIRINGPI_INIT_ != 1)
-	{
-		fprintf(stderr,"You havent initialized wiringPi library. Use RoverBase::initialize() !\n");
-	}
-	else if (this->ROVER_GPIO_INIT_ != 1)
-	{
-		fprintf(stderr,"You havent initialized RoverDisplay. Use RoverGpio::initialize() !\n");
-	}
-	else
-	{
-		return this->myRoverGpio;
-	}
-}
-
-rover::RoverDisplay& rover::RoverBase::inRoverDisplay (void)
-{
-	if (this->WIRINGPI_INIT_ != 1)
-	{
-		fprintf(stderr,"You havent initialized wiringPi library. Use RoverBase::initialize() !\n");
-	}
-	else if (this->ROVER_DISPLAY_INIT_ != 1)
-	{
-		fprintf(stderr,"You havent initialized RoverDisplay. Use RoverBase::initialize() !\n");
-	}
-	else
-	{
-		return this->myRoverDisplay;
-	}
-}
-
-rover::RoverSensors& rover::RoverBase::inRoverSensors (void)
-{
-	if (this->WIRINGPI_INIT_ != 1)
-	{
-		fprintf(stderr,"You havent initialized wiringPi library. Use RoverBase::initialize() !\n");
-	}
-	else if (this->ROVER_SENSORS_INIT_ != 1)
-	{
-		fprintf(stderr,"You havent initialized RoverSensors. Use RoverBase::initialize() !\n");
-	}
-	else
-	{
-		return this->myRoverSensors;
-	}
-}
-
-void rover::RoverBase::initializeRoverSensors (void)
-{
-	if (this->WIRINGPI_INIT_ != 1)
-	{
-		fprintf(stderr,"You havent initialized wiringPi library. Use RoverBase::initialize() !\n");
-	}
-	else if (this->ROVER_SENSORS_INIT_ != 1)
-	{
-		this->myRoverSensors.initialize();
-		this->ROVER_SENSORS_INIT_ = 1;
-	}
-}
-
-void rover::RoverBase::initializeRoverGpio (void)
-{
-	if (this->WIRINGPI_INIT_ != 1)
-	{
-		fprintf(stderr,"You havent initialized wiringPi library. Use RoverBase::initialize() !\n");
-	}
-	else if (this->ROVER_GPIO_INIT_ != 1)
-	{
-		this->myRoverGpio.initialize();
-		this->ROVER_GPIO_INIT_ = 1;
-	}
-}
-
-void rover::RoverBase::initializeRoverDisplay (void)
-{
-	if (this->WIRINGPI_INIT_ != 1)
-	{
-		fprintf(stderr,"You havent initialized wiringPi library. Use RoverBase::initialize() !\n");
-	}
-	else if (this->ROVER_DISPLAY_INIT_ != 1)
-	{
-		this->myRoverDisplay.initialize();
-		this->ROVER_DISPLAY_INIT_ = 1;
-	}
-}
-
-void rover::RoverBase::initializeRoverDriving (void)
-{
-	if (this->WIRINGPI_INIT_ != 1)
-	{
-		fprintf(stderr,"You havent initialized wiringPi library. Use RoverBase::initialize() !\n");
-	}
-	else if (this->ROVER_DRIVING_INIT_ != 1)
-	{
-		this->myRoverDriving.initialize();
-		this->ROVER_DRIVING_INIT_ = 1;
-	}
-}
-
diff --git a/rover/src/roverapi/rover_cloud.cpp b/rover/src/roverapi/rover_cloud.cpp
index 2b8cff2..5e40f0b 100644
--- a/rover/src/roverapi/rover_cloud.cpp
+++ b/rover/src/roverapi/rover_cloud.cpp
@@ -22,14 +22,23 @@
 #include <string.h>
 
 rover::RoverCloud::RoverCloud()
+:REGISTRATION_PORT(1),
+ TENANT_NAME("N"),
+ PORT(1),
+ HOST_NAME("N")
 {
-	this->REGISTRATION_PORT = 1;
-	this->TENANT_NAME = "N";
-	this->PORT = 1;
-	this->HOST_NAME = "N";
+
 }
 
-int rover::RoverCloud::attributeErrorCheck (void)
+rover::RoverCloud::RoverCloud(char * host_name, const int port, const int registration_port, char * tenant_name)
+{
+	this->HOST_NAME = host_name;
+	this->PORT = port;
+	this->REGISTRATION_PORT = registration_port;
+	this->TENANT_NAME = tenant_name;
+}
+
+int rover::RoverCloud::attributeErrorCheck (void) const
 {
 	if (this->PORT == 1 || this->TENANT_NAME[0] == 'N' || this->HOST_NAME[0] == 'N')
 	{
@@ -85,7 +94,7 @@
 	}
 }
 
-void rover::RoverCloud::setHono (char * host_name, int port, char * tenant)
+void rover::RoverCloud::setHono (char * host_name, const int port, char * tenant) const
 {
 
 	this->HOST_NAME = host_name;
@@ -93,42 +102,42 @@
 	this->TENANT_NAME = tenant;
 }
 
-void rover::RoverCloud::setHostName (char * host_name)
+void rover::RoverCloud::setHostName (char * host_name) const
 {
 	this->HOST_NAME = host_name;
 }
 
-void rover::RoverCloud::setPort (int port)
+void rover::RoverCloud::setPort (const int port) const
 {
 	this->PORT = port;
 }
 
-void rover::RoverCloud::setRegistrationPort (int port)
+void rover::RoverCloud::setRegistrationPort (const int port) const
 {
 	this->REGISTRATION_PORT = port;
 }
 
-int rover::RoverCloud::getRegistrationPort (void)
+int rover::RoverCloud::getRegistrationPort (void) const
 {
 	return this->REGISTRATION_PORT;
 }
 
-void rover::RoverCloud::setTenantName (char * tenant)
+void rover::RoverCloud::setTenantName (char * tenant) const
 {
 	this->TENANT_NAME = tenant;
 }
 
-char * rover::RoverCloud::getHostName (void)
+char * rover::RoverCloud::getHostName (void) const
 {
 	return this->HOST_NAME;
 }
 
-int  rover::RoverCloud::getPort (void)
+int  rover::RoverCloud::getPort (void) const
 {
 	return this->PORT;
 }
 
-char * rover::RoverCloud::getTenantName (void)
+char * rover::RoverCloud::getTenantName (void) const
 {
 	return this->TENANT_NAME;
 }
diff --git a/rover/src/roverapi/rover_display.cpp b/rover/src/roverapi/rover_display.cpp
index dcb67ce..635ff66 100644
--- a/rover/src/roverapi/rover_display.cpp
+++ b/rover/src/roverapi/rover_display.cpp
@@ -44,6 +44,12 @@
 #include <drivers/oled_drivers/ArduiPi_SSD1306.h>
 #include <drivers/oled_drivers/Adafruit_GFX.h>
 
+rover::RoverDisplay::RoverDisplay()
+:ROVER_DISPLAY_INIT_(0)
+{
+
+}
+
 void rover::RoverDisplay::initialize(void)
 {
 	/* Type to describe default options for the OLED initialization */
@@ -65,74 +71,128 @@
 
 	this->my_display.begin();
 	this->my_display.clearDisplay();   // clears the screen and buffer
+
+	this->ROVER_DISPLAY_INIT_ = 1;
 }
 
 void rover::RoverDisplay::display(void)
 {
-
-	this->my_display.display();
+	if (this->ROVER_DISPLAY_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDisplay. Use RoverDisplay()::initialize() !\n");
+	}
+	else
+	{
+		this->my_display.display();
+	}
 
 }
 
 void rover::RoverDisplay::clearDisplay(void)
 {
-
-	this->my_display.clearDisplay();
+	if (this->ROVER_DISPLAY_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDisplay. Use RoverDisplay()::initialize() !\n");
+	}
+	else
+	{
+		this->my_display.clearDisplay();
+	}
 
 }
 
 void rover::RoverDisplay::drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color)
 {
-
-	this->my_display.drawBitmap(x, y, bitmap, w, h, color);
-
+	if (this->ROVER_DISPLAY_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDisplay. Use RoverDisplay()::initialize() !\n");
+	}
+	else
+	{
+		this->my_display.drawBitmap(x, y, bitmap, w, h, color);
+	}
 }
 
 void rover::RoverDisplay::setCursor (int16_t x, int16_t y)
 {
-
-	this->my_display.setCursor (x, y);
-
+	if (this->ROVER_DISPLAY_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDisplay. Use RoverDisplay()::initialize() !\n");
+	}
+	else
+	{
+		this->my_display.setCursor (x, y);
+	}
 }
 
 void rover::RoverDisplay::setTextSize (uint8_t s)
 {
-
-	this->my_display.setTextSize (s);
-
+	if (this->ROVER_DISPLAY_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDisplay. Use RoverDisplay()::initialize() !\n");
+	}
+	else
+	{
+		this->my_display.setTextSize (s);
+	}
 }
 
 void rover::RoverDisplay::setTextColor (uint16_t c)
 {
-
-	this->my_display.setTextColor (c);
-
+	if (this->ROVER_DISPLAY_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDisplay. Use RoverDisplay()::initialize() !\n");
+	}
+	else
+	{
+		this->my_display.setTextColor (c);
+	}
 }
 
 void rover::RoverDisplay::setTextColor (uint16_t c, uint16_t b)
 {
-
-	this->my_display.setTextColor (c, b);
-
+	if (this->ROVER_DISPLAY_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDisplay. Use RoverDisplay()::initialize() !\n");
+	}
+	else
+	{
+		this->my_display.setTextColor (c, b);
+	}
 }
 
 void rover::RoverDisplay::print (const char * string)
 {
-
-	this->my_display.print (string);
-
+	if (this->ROVER_DISPLAY_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDisplay. Use RoverDisplay()::initialize() !\n");
+	}
+	else
+	{
+		this->my_display.print (string);
+	}
 }
 
 void rover::RoverDisplay::drawRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
 {
-
-	this->my_display.drawRect (x, y, w, h, color);
-
+	if (this->ROVER_DISPLAY_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDisplay. Use RoverDisplay()::initialize() !\n");
+	}
+	else
+	{
+		this->my_display.drawRect (x, y, w, h, color);
+	}
 }
 
 Adafruit_SSD1306& rover::RoverDisplay::getDisplay (void)
 {
-
-	return this->my_display;
-
+	if (this->ROVER_DISPLAY_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDisplay. Use RoverDisplay()::initialize() !\n");
+	}
+	else
+	{
+		return this->my_display;
+	}
 }
diff --git a/rover/src/roverapi/rover_driving.cpp b/rover/src/roverapi/rover_driving.cpp
index 943ab3a..b9fbf41 100644
--- a/rover/src/roverapi/rover_driving.cpp
+++ b/rover/src/roverapi/rover_driving.cpp
@@ -23,10 +23,12 @@
 #include <unistd.h>
 
 rover::RoverDriving::RoverDriving()
+:SPEED(HIGHEST_SPEED),
+ ROVERDRIVING_INIT_(0)
 {
-	this->SPEED = this->HIGHEST_SPEED;
+
 }
-void rover::RoverDriving::setSpeed (int speed_setpoint)
+void rover::RoverDriving::setSpeed (const int speed_setpoint)
 {
 	this->SPEED = speed_setpoint;
 }
@@ -48,53 +50,118 @@
 	pinMode (DIRECTION_PIN_RIGHT, OUTPUT) ;
 
 
-	softPwmCreate (SOFT_PWM_ENGINE_LEFT, 0, this->HIGHEST_SPEED) ;
-	softPwmCreate (SOFT_PWM_ENGINE_RIGHT, 0, this->HIGHEST_SPEED) ;
+	softPwmCreate (SOFT_PWM_ENGINE_LEFT, 0, HIGHEST_SPEED) ;
+	softPwmCreate (SOFT_PWM_ENGINE_RIGHT, 0, HIGHEST_SPEED) ;
 
 	pinMode (FLASH_LIGHT_LED, OUTPUT) ;
+
+	this->ROVERDRIVING_INIT_ = 1;
 }
 
 void rover::RoverDriving::turnForwardRight (void)
 {
-	turn(FORWARD, LEFT, this->SPEED);
+	if (this->ROVERDRIVING_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDriving. Use RoverDriving()::initialize() !\n");
+	}
+	else
+	{
+		turn(FORWARD, LEFT, this->SPEED);
+	}
 }
 
 void rover::RoverDriving::turnForwardLeft (void)
 {
-	turn(FORWARD, RIGHT, this->SPEED);
+	if (this->ROVERDRIVING_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDriving. Use RoverDriving()::initialize() !\n");
+	}
+	else
+	{
+		turn(FORWARD, RIGHT, this->SPEED);
+	}
 }
 
 void rover::RoverDriving::turnBackwardRight (void)
 {
-	turn(BACKWARD, LEFT, this->SPEED);
+	if (this->ROVERDRIVING_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDriving. Use RoverDriving()::initialize() !\n");
+	}
+	else
+	{
+		turn(BACKWARD, LEFT, this->SPEED);
+	}
 }
 
 void rover::RoverDriving::turnBackwardLeft (void)
 {
-	turn(BACKWARD, RIGHT, this->SPEED);
+	if (this->ROVERDRIVING_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDriving. Use RoverDriving()::initialize() !\n");
+	}
+	else
+	{
+		turn(BACKWARD, RIGHT, this->SPEED);
+	}
 }
 
 void rover::RoverDriving::turnLeft (void)
 {
-	turnOnSpot(FORWARD, LEFT, this->SPEED);
+	if (this->ROVERDRIVING_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDriving. Use RoverDriving()::initialize() !\n");
+	}
+	else
+	{
+		turnOnSpot(FORWARD, LEFT, this->SPEED);
+	}
 }
 
 void rover::RoverDriving::turnRight (void)
 {
-	turnOnSpot(FORWARD, RIGHT, this->SPEED);
+	if (this->ROVERDRIVING_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDriving. Use RoverDriving()::initialize() !\n");
+	}
+	else
+	{
+		turnOnSpot(FORWARD, RIGHT, this->SPEED);
+	}
 }
 
 void rover::RoverDriving::goForward (void)
 {
-	go(FORWARD, this->SPEED);
+	if (this->ROVERDRIVING_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDriving. Use RoverDriving()::initialize() !\n");
+	}
+	else
+	{
+		go(FORWARD, this->SPEED);
+	}
 }
 
 void rover::RoverDriving::goBackward (void)
 {
-	go(BACKWARD, this->SPEED);
+	if (this->ROVERDRIVING_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDriving. Use RoverDriving()::initialize() !\n");
+	}
+	else
+	{
+		go(BACKWARD, this->SPEED);
+	}
 }
 
 void rover::RoverDriving::stopRover (void)
 {
-	stop();
+	if (this->ROVERDRIVING_INIT_ != 1)
+	{
+		fprintf(stderr,"You havent initialized RoverDriving. Use RoverDriving()::initialize() !\n");
+	}
+	else
+	{
+		stop();
+	}
 }
diff --git a/rover/src/roverapi/rover_gpio.cpp b/rover/src/roverapi/rover_gpio.cpp
index 28e277e..5b2cc80 100644
--- a/rover/src/roverapi/rover_gpio.cpp
+++ b/rover/src/roverapi/rover_gpio.cpp
@@ -16,80 +16,42 @@
 #include <roverapi/rover_gpio.hpp>
 #include <wiringPi.h>
 #include <softTone.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
 
-void rover::RoverGpio::initialize (void)
-{
-	//wiringPiSetup();
-	/* Setup buzzer */
-	pinMode (this->BUZZER_PIN, SOFT_TONE_OUTPUT);
-	softToneCreate (this->BUZZER_PIN);
-
-	/* Setup shutdown button */
-	pinMode (this->SHUTDOWN_BUTTON_PIN, INPUT);
-
-	/* Setup user button */
-	pinMode (this->USER_BUTTON_PIN, INPUT);
-}
 
 rover::RoverGpio::RoverGpio()
 {
-	/* Initialize default buzzer frequency */
-	this->BUZZER_FREQUENCY = 200;
+
 }
 
-void rover::RoverGpio::setBuzzerFrequency (int buzzer_freq)
-{
-	this->BUZZER_FREQUENCY = buzzer_freq;
-}
-
-int rover::RoverGpio::getBuzzerFrequency (void)
-{
-	return this->BUZZER_FREQUENCY;
-}
-
-void rover::RoverGpio::setBuzzerOn (void)
-{
-	softToneWrite (this->BUZZER_PIN, this->BUZZER_FREQUENCY);
-}
-
-void rover::RoverGpio::setBuzzerOff (void)
-{
-	softToneWrite (this->BUZZER_PIN, 0);
-}
-
-void rover::RoverGpio::shutdownTone (void)
-{
-	softToneWrite (this->BUZZER_PIN, 300);
-	delay(2000);
-	softToneWrite (BUZZER_PIN, 0);
-}
-
-void rover::RoverGpio::setBuzzerTone (int buzzer_freq)
-{
-	softToneWrite (this->BUZZER_PIN, buzzer_freq);
-}
-
-int rover::RoverGpio::readUserButton (void)
-{
-	return digitalRead (this->USER_BUTTON_PIN);
-}
-
-int rover::RoverGpio::readShutdownButton (void)
-{
-	return digitalRead (this->SHUTDOWN_BUTTON_PIN);
-}
-
-void rover::RoverGpio::wPiDigitalWrite (int pin, int value)
+void rover::RoverGpio::wPiDigitalWrite (const int pin, const int value)
 {
 	digitalWrite (pin, value);
 }
 
-int rover::RoverGpio::wPiDigitalRead (int pin)
+int rover::RoverGpio::wPiDigitalRead (const int pin)
 {
 	return digitalRead (pin);
 }
 
-void rover::RoverGpio::wPiPinMode (int pin, int set_val)
+void rover::RoverGpio::wPiPinMode (const int pin, const int set_val)
 {
 	pinMode (pin, set_val);
 }
+
+void rover::RoverGpio::wPiSoftToneCreate (const int pin)
+{
+	softToneCreate (pin);
+}
+
+void rover::RoverGpio::wPiSoftToneWrite (const int pin, const int tone)
+{
+	softToneWrite (pin, tone);
+}
+
+void rover::RoverGpio::wPiDelay (const int period_ms)
+{
+	delay (period_ms);
+}