The STEAM Org Robotics Kit  v1
Ultrasonic.h
1 #ifndef ULTRASONIC_H
2 #define ULTRASONIC_H
3 
4 #include "Arduino.h"
5 
9 class Ultrasonic {
10 public:
15  Ultrasonic(u_int8_t trig, u_int8_t echo);
23  int getDistance();
24 
25 private:
26  u_int8_t _trig;
27  u_int8_t _echo;
28 };
29 
30 #endif
Allows to interface with a standard ultrasonic sensor.
Definition: Ultrasonic.h:9
int getDistance()
Triggers the ir sensor and gets the distance recorded by it in centimeters.
Definition: Ultrasonic.cpp:12
Ultrasonic(u_int8_t trig, u_int8_t echo)
Definition: Ultrasonic.cpp:3