Basic library for Pololu's Sharp GP2Y0A51SK0F
Dependencies: mbed
Dependents: GrabTest R5 2016 Robotics Team 1
DistanceSensor.h@2:6ebd72287e97, 2016-04-08 (annotated)
- Committer:
- j_j205
- Date:
- Fri Apr 08 01:35:57 2016 +0000
- Revision:
- 2:6ebd72287e97
- Parent:
- 1:8db052ec94f1
latest localization
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Hypna | 0:d03df6dd14d6 | 1 | #ifndef DISTANCE_SENSOR_H |
Hypna | 0:d03df6dd14d6 | 2 | #define DISTANCE_SENSOR_H |
Hypna | 0:d03df6dd14d6 | 3 | |
Hypna | 0:d03df6dd14d6 | 4 | #include "mbed.h" |
Hypna | 0:d03df6dd14d6 | 5 | |
Hypna | 0:d03df6dd14d6 | 6 | class DistanceSensor |
Hypna | 0:d03df6dd14d6 | 7 | { |
Hypna | 0:d03df6dd14d6 | 8 | public: |
Hypna | 1:8db052ec94f1 | 9 | DistanceSensor(PinName ai, int profNum); |
Hypna | 1:8db052ec94f1 | 10 | double getDistance(); |
Hypna | 0:d03df6dd14d6 | 11 | |
Hypna | 0:d03df6dd14d6 | 12 | private: |
Hypna | 0:d03df6dd14d6 | 13 | AnalogIn voltage; |
Hypna | 1:8db052ec94f1 | 14 | int prof; |
Hypna | 0:d03df6dd14d6 | 15 | }; |
Hypna | 0:d03df6dd14d6 | 16 | |
Hypna | 0:d03df6dd14d6 | 17 | #endif |