diff options
author | neoraider <devnull@localhost> | 2007-04-16 00:01:04 +0200 |
---|---|---|
committer | neoraider <devnull@localhost> | 2007-04-16 00:01:04 +0200 |
commit | d02fbc84105ff2da74f03fd658ace8919e3e9437 (patch) | |
tree | a9ab5298ca9584e7eabc0bcb6d8b34ca1ad55726 /Srf10.h | |
parent | ccc0183cee7c410d668a0b1a9153b061a4785e42 (diff) | |
download | rc2007-rescue-d02fbc84105ff2da74f03fd658ace8919e3e9437.tar rc2007-rescue-d02fbc84105ff2da74f03fd658ace8919e3e9437.zip |
LineSensorArray + Srf10 added.
Diffstat (limited to 'Srf10.h')
-rw-r--r-- | Srf10.h | 44 |
1 files changed, 44 insertions, 0 deletions
@@ -0,0 +1,44 @@ +#ifndef SRF10_H_ +#define SRF10_H_ + +#include <stdint.h> + + +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_*/ |