Smartcar Shield
GP2Y0A21.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  GP2Y0A21(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 
GP2Y0A21::GP2Y0A21
GP2Y0A21(Runtime &runtime, uint8_t pin)
Constructs a GP2Y0A21 sensor.
Definition: GP2Y0A21.cpp:9
Runtime
Definition: Runtime.hpp:35
InfraredAnalogSensor
Definition: InfraredAnalogSensor.hpp:25
GP2Y0A21::getDistance
unsigned int getDistance() override
Gets the distance measured by the sensor in centimeters.
Definition: GP2Y0A21.cpp:16
GP2Y0A21
Definition: GP2Y0A21.hpp:11