Skip to content
New issue

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

Wrong values #5

Open
eduardo31 opened this issue Feb 20, 2021 · 1 comment
Open

Wrong values #5

eduardo31 opened this issue Feb 20, 2021 · 1 comment

Comments

@eduardo31
Copy link

the values printing on serial are diferent then the ones returned:
LPG:2689.00ppm CO:-22786.00ppm SMOKE:25400.00ppm
0.00
0.00
0.00
0.00
TIME MILLIS: 51785
LPG:550.00ppm CO:17836.00ppm SMOKE:6131.00ppm
0.00
0.00
0.00
0.00
TIME MILLIS: 55341
LPG:2100.00ppm CO:-28364.00ppm SMOKE:1688.00ppm
0.00
0.00
0.00
0.00

Code:

void ReadMQ2(){
float* values = mq2.read(true); //set it false if you don't want to print the values in the Serial
Serial.println(values[0]);
Serial.println(values[1]);
Serial.println(values[2]);
lpg = values[0];
co = values[1];
smoke = values[2];
Serial.println(String(co));
}

@labay11
Copy link
Owner

labay11 commented Feb 20, 2021

Hello @eduardo31 this library needed a cleanup a long time ago but I didn't do it since now. I have made some changes, can you try with the new code? As I said in a another issue, I am not longer in possession of this sensor but this, together with #4 seems like programming issue which I expect to have solved in the new version. If that is not the case, please tell me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants