//**************************** // Created by: // Larsha Johnson // 2/29/16 // HCSR04 Header file //**************************** /* This library controls the HCSR-04 Proximity Sensor for use with an Arduino. The sensor outputs the distance of an object in cm. It also outputs is the object is near, far or holding position. */ //Define this file to allow use via Arduino #ifndef HCSR04_h #define HCSR04_h #undef int //Allows use of functions that return as integers #include "Arduino.h" //Includes the Arduino library header //Assigns class class HCSR04ProxSensor{ public: //Assigns constructor. Called when a new object is created HCSR04ProxSensor(int echoPin, int trigPin); //Assigns public integers int distance; int prevDist; //Assigns public functions int readSensor(); int getLastValue(); void start(); //************************************************************************** //Cannot accidently be changed private: //Assigns private variables for use in HCSR04.cpp int _trigPin; int _echoPin; int _dist; int _prevDist; }; #endif //End