From d02fbc84105ff2da74f03fd658ace8919e3e9437 Mon Sep 17 00:00:00 2001 From: neoraider Date: Sun, 15 Apr 2007 22:01:04 +0000 Subject: LineSensorArray + Srf10 added. --- Srf10.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Srf10.h (limited to 'Srf10.h') diff --git a/Srf10.h b/Srf10.h new file mode 100644 index 0000000..efb8cfb --- /dev/null +++ b/Srf10.h @@ -0,0 +1,44 @@ +#ifndef SRF10_H_ +#define SRF10_H_ + +#include + + +enum Srf10Units { + Inches = 0x50, Centimeters = 0x51, Microseconds = 0x52 +}; + +class Srf10 +{ +private: + uint8_t id; + + uint8_t gain; + uint8_t range; + + int firmware; + + long distance; + + Srf10Units unit; + + int readFirmware(); +public: + Srf10(uint8_t id); + + uint8_t getGain() {return gain;} + bool setGain(uint8_t gain); + + uint8_t getRange() {return range;} + bool setRange(uint8_t range); + + Srf10Units getUnit() {return unit;} + void setUnit(Srf10Units unit) {this->unit = unit;} + + int getFirmware() {return firmware;} + + long updateDistance(); + long getDistance() {return distance;} +}; + +#endif /*SRF10_H_*/ -- cgit v1.2.3