![](/media/cache/profiles/8cf40e328089249cf77075692aa0c09b.jpg.50x50_q85.jpg)
CO2 Sensor MH-Z19 Class (uses interrupt input as PWM input)
Diff: main.cpp
- Revision:
- 0:3c154d34f47e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Aug 11 00:41:23 2016 +0000 @@ -0,0 +1,18 @@ +#include "mbed.h" +#include "MH_Z19.h" + +DigitalOut myled(LED1); +MH_Z19 Sen(p5); + +int main() { + + wait(2); + + while(1) { + myled = 1; + wait(0.2); + myled = 0; + printf("CO2 PPM:%d\n",Sen.ReadCO2PPM()); + wait(1.8); + } +}