Flair
Framework Libre Air
Srf08.h
Go to the documentation of this file.
1 // %flair:license{
2 // This file is part of the Flair framework distributed under the
3 // CECILL-C License, Version 1.0.
4 // %flair:license}
13 #ifndef SRF08_H
14 #define SRF08_H
15 
16 #include <Thread.h>
17 #include <UsRangeFinder.h>
18 
19 namespace flair {
20 namespace core {
21 class I2cPort;
22 }
23 namespace gui {
24 class SpinBox;
25 }
26 }
27 
28 namespace flair {
29 namespace sensor {
34 class Srf08 : public core::Thread, public UsRangeFinder {
35 
36 public:
48  Srf08(std::string name,
49  core::I2cPort *i2cport, uint16_t address, uint8_t priority);
50 
55  ~Srf08();
56 
62  void SetRange(void);
63 
69  void SetMaxGain(void);
70 
71 private:
79  void UpdateFrom(const core::io_data *data){};
80 
87  void Run(void);
88 
89  void SendEcho(void);
90  void GetEcho(void);
91 
92  bool is_init;
93  core::Time echo_time;
94  float z_1, z_2;
95  gui::SpinBox *gain, *range;
96  uint16_t address;
97  core::I2cPort *i2cport;
98 };
99 } // end namespace sensor
100 } // end namespace flair
101 #endif // SRF08_H
Abstract class for data types.
Definition: io_data.h:94
Class for ultra sonic SRF08.
Definition: Srf08.h:34
namespace of the flair Framework
Definition: Ahrs.h:19
void SetRange(void)
Set Range.
unsigned long long Time
Time definition, in ns.
Definition: Object.h:49
Base class for UsRangeFinder.
Definition: UsRangeFinder.h:40
Class displaying a QSpinBox on the ground station.
Definition: SpinBox.h:28
void SetMaxGain(void)
Set Max Gain.
Base class for UsRangeFinder.
Srf08(std::string name, core::I2cPort *i2cport, uint16_t address, uint8_t priority)
Constructor.
Abstract class for a thread.
Abstract class for a thread.
Definition: Thread.h:38
Base class for i2c port.
Definition: I2cPort.h:31
~Srf08()
Destructor.