A library for the MQ2 sensor. Based on https://github.com/labay11 and http://sandboxelectronics.com/?p=165

Dependents:   mq2_example mq2_midtermproject ECE595_Group9_FinalProject mq2_example ... more

Revision:
6:c0ebeb4b47b6
Parent:
5:8b7ba76a7a76
--- a/MQ2.cpp	Fri Oct 06 08:57:00 2017 +0000
+++ b/MQ2.cpp	Fri Oct 06 08:58:43 2017 +0000
@@ -78,7 +78,7 @@
   int i;
   float rs=0;
   for (i=0;i<READ_SAMPLE_TIMES;i++) {
-    rs += MQResistanceCalculation(_pin.read_16>>6());
+    rs += MQResistanceCalculation(_pin.read_u16()>>6);
     wait_ms(READ_SAMPLE_INTERVAL);
   }
   rs = rs/READ_SAMPLE_TIMES;