TI RSLK Library 0.2.2
Loading...
Searching...
No Matches
GP2Y0A21_Sensor.h
1#ifndef GP2Y0A21_Sensor_h
2#define GP2Y0A21_Sensor_h
3
4#include "Energia.h"
5
9
11{
12private:
13 uint8_t ir_sensor_pin;
14 uint8_t num_pins;
15 bool configured;
16
17public:
19
29 bool begin(uint8_t pin_num, uint8_t mode = INPUT_PULLDOWN);
30
38 uint16_t read();
39
46 int16_t readMM();
47
54 float readIN();
55};
56
57#endif
Class for Pololu's Sharp GP2Y0A21YK0F analog distance sensor.
int16_t readMM()
Read the distance from the Sharp distance sensor in millimeters.
bool begin(uint8_t pin_num, uint8_t mode=INPUT_PULLDOWN)
Initialize the distance sensor class.
float readIN()
Read the distance from the Sharp distance sensor in inches.
uint16_t read()
Read the value from distance sensor.