Smartcar Shield
GP2D120.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include "../../../../../runtime/Runtime.hpp"
9 #include "../InfraredAnalogSensor.hpp"
10 
12 {
13 public:
26  GP2D120(Runtime& runtime, uint8_t pin);
27 
28  /* Check `DistanceSensor` interface for documentation */
29  unsigned int getDistance() override;
30 
31 private:
32  const uint8_t kPin;
33  Runtime& mRuntime;
34 };
35 
GP2D120::GP2D120
GP2D120(Runtime &runtime, uint8_t pin)
Constructs a GP2D120 sensor.
Definition: GP2D120.cpp:9
Runtime
Definition: Runtime.hpp:35
InfraredAnalogSensor
Definition: InfraredAnalogSensor.hpp:25
GP2D120::getDistance
unsigned int getDistance() override
Gets the distance measured by the sensor in centimeters.
Definition: GP2D120.cpp:16
GP2D120
Definition: GP2D120.hpp:11