Smartcar Shield
src
sensors
distance
infrared
analog
sharp
GP2Y0A02.hpp
Go to the documentation of this file.
1
6
#pragma once
7
8
#include "../../../../../runtime/Runtime.hpp"
9
#include "../InfraredAnalogSensor.hpp"
10
11
class
GP2Y0A02
:
public
InfraredAnalogSensor
12
{
13
public
:
26
GP2Y0A02
(
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
GP2Y0A02
Definition:
GP2Y0A02.hpp:11
Runtime
Definition:
Runtime.hpp:35
InfraredAnalogSensor
Definition:
InfraredAnalogSensor.hpp:25
GP2Y0A02::GP2Y0A02
GP2Y0A02(Runtime &runtime, uint8_t pin)
Constructs a GP2Y0A02 sensor.
Definition:
GP2Y0A02.cpp:9
GP2Y0A02::getDistance
unsigned int getDistance() override
Gets the distance measured by the sensor in centimeters.
Definition:
GP2Y0A02.cpp:16
Generated by
1.8.17