Smartcar Shield
Loading...
Searching...
No Matches
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{
13public:
26 GP2D120(Runtime& runtime, uint8_t pin);
27
28 /* Check `DistanceSensor` interface for documentation */
29 unsigned int getDistance() override;
30
31private:
32 const uint8_t kPin;
33 Runtime& mRuntime;
34};
35
Programmatically represents a SHARP GP2D120 infrared sensor.
Definition GP2D120.hpp:12
unsigned int getDistance() override
Gets the distance measured by the sensor in centimeters.
Definition GP2D120.cpp:16
An abstract class to represent the various infrared analog sensors.
An interface to serve as a wrapper for the native runtime environment, greatly inspired by the Arduin...
Definition Runtime.hpp:36