sr501+BH1750+mq

Dependencies:   mbed

Fork of sensors by w mx

Revision:
2:cd0ea77c7d66
Parent:
1:1197997ae0ea
Child:
3:31aec950f7dc
--- a/sensors.h	Wed Sep 12 15:51:26 2018 +0000
+++ b/sensors.h	Thu Sep 13 05:52:55 2018 +0000
@@ -2,6 +2,7 @@
 #define SENSORS_H
 
 #include "mbed.h"
+
 //+++++++++++++++++++++BH1750+++++++++++++++++++++++++++++
 #define BH1750_I2CADDR 0x46
 #define BH1750_POWER_DOWN 0x00                  // No active state
@@ -24,7 +25,7 @@
 #define BH1750_ONE_TIME_LOW_RES_MODE  0x23
 //++++++++++++++++++++++++++++++++++++++++
 
-
+//==========================================
 class sr501
 {
 /*****
@@ -34,8 +35,7 @@
   private:
 //    DigitalIn signal;
     bool status;
-    InterruptIn signal1;
-    DigitalIn signal2;
+    InterruptIn signal;
     void triggered();
   public:
     sr501(PinName pSignal);
@@ -48,7 +48,7 @@
 {
     
 /*****
-
+*
 *****/
   private:
     I2C link;
@@ -59,4 +59,26 @@
     BH1750(PinName sda,PinName scl,char mode[]);
     float getlightdata();
 };
+//===========================================
+class mq
+{
+/*****
+*
+*****/
+  private:
+    bool status;
+    InterruptIn signal;
+    AnalogIn signallevel;
+    
+    void triggered();                                     
+  public:
+    mq(PinName dio);
+    mq(PinName dio,PinName aio);
+    bool operator==(const bool &target);
+    float getairdata(); 
+    void reset();
+    int mq::read();
+};
+
+//===========================================
 #endif