We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
Do I need to make alteration in the code (except for the pins ofcourse) to get this to work on an ESP8266 board.
I only get a question mark for the moment..
/*---------------------------------------------------------- MH-Z19 CO2 sensor SAMPLE ----------------------------------------------------------*/ #include "MHZ19.h" const int rx_pin = 3; //Serial rx pin no const int tx_pin = 1; //Serial tx pin no const int pwmpin = 2; MHZ19 *mhz19_uart = new MHZ19(rx_pin,tx_pin); MHZ19 *mhz19_pwm = new MHZ19(pwmpin); /*---------------------------------------------------------- MH-Z19 CO2 sensor setup ----------------------------------------------------------*/ void setup() { Serial.begin(115200); mhz19_uart->begin(rx_pin, tx_pin); mhz19_uart->setAutoCalibration(false); while (mhz19_uart->isWarming()) { Serial.print("MH-Z19 now warming up... status:"); Serial.println(mhz19_uart->getStatus()); delay(1000); } } /*---------------------------------------------------------- MH-Z19 CO2 sensor loop ----------------------------------------------------------*/ void loop() { measurement_t m = mhz19_uart->getMeasurement(); Serial.print("co2: "); Serial.println(m.co2_ppm); Serial.print("temp: "); Serial.println(m.temperature); int co2ppm = mhz19_pwm->getPpmPwm(); Serial.print("co2: "); Serial.println(co2ppm); delay(5000); }
The text was updated successfully, but these errors were encountered:
I will strongly recommend you use what Issue #14 proposes as a workaround.
Sorry, something went wrong.
No branches or pull requests
Hi,
Do I need to make alteration in the code (except for the pins ofcourse) to get this to work on an ESP8266 board.
I only get a question mark for the moment..
The text was updated successfully, but these errors were encountered: