/* Library Repository : https://github.com/ckalpha/MQ135 Author : Damrongwit Nusuk Email : jack@racksync.com Website : http://www.racksync.com */ #include "MQ135.h" #define ANALOGPIN A0 // Define Analog PIN on Arduino Board #define RZERO 206.85 // Define RZERO Calibration Value MQ135 gasSensor = MQ135(ANALOGPIN); void setup() { Serial.begin(9600); float rzero = gasSensor.getRZero(); delay(3000); Serial.print("MQ135 RZERO Calibration Value : "); Serial.println(rzero); } void loop() { float ppm = gasSensor.getPPM(); delay(1000); digitalWrite(13,HIGH); Serial.print("CO2 ppm value : "); Serial.println(ppm); } ```
進階搜尋