Code for sensor nodes connected by radio receiver with gateway
Dependencies: mbed WakeUp coapRadioClient DHT11
distanceMeter.h
00001 #ifndef MBEDDED_DISTANCEMETER_H 00002 #define MBEDDED_DISTANCEMETER_H 00003 00004 #include "sensor.h" 00005 00006 class DistanceMeter : public Sensor { 00007 private: 00008 InterruptIn echo; 00009 DigitalOut trigger; 00010 00011 Timer timer; 00012 int timeUs; 00013 bool timeReady; 00014 00015 void echoUp(); 00016 void echoDown(); 00017 00018 public: 00019 int read(); 00020 00021 int getSensorId(); 00022 00023 void initialize(); 00024 00025 DistanceMeter(PinName echoPin, PinName triggerPin); 00026 }; 00027 00028 #endif //MBEDDED_DISTANCEMETER_H
Generated on Fri Jul 15 2022 10:06:21 by 1.7.2