//********************************************************* // // Student Name: Constance Luong // UID: U6709-3342 // Date: Spring 2015, February 25, 2015 // File name: HCSR04ProxSensor.h // Assignment: Deliverable 3 // Goal: To create a library using C++ code that controls // the HCSR04 Proximity Sensor on the Arduino Board // //********************************************************** #ifndef HCSR04_h #define HCSR04_h #include "Arduino.h" // Class definition for HCSR04ProxSensor type class HCSR04ProxSensor { // Functions for class HCSR04ProxSensor public: HCSR04ProxSensor(int triggerPin, int echoPin); // Constructor for HCSR04ProxSensor object with two parameters float readSensor(); // Measures distance captured from readings of burst measurements float getLastValue(); // Establishing private variables and type (integers and decimal) private: int _triggerPin; int _echoPin; float _distance; // float == allows for decimal numbers float _distance2; }; // end class definition #endif