For my IoT project, I'm creating a smoke and gas detector. Although I am using #include <MQUnifiedsensor.h> and also <MQ2.h> in my code, it appears that the readTemperature member of the MQ2 class is missing. Can somebody help me to check the error?
C:\Users\User\OneDrive\Documents\Arduino\coding-2\coding-2\coding-2.ino: In function 'void setup()':
C:\Users\User\OneDrive\Documents\Arduino\coding-2\coding-2\coding-2.ino:27:3: error: 'mq2' was not declared in this scope
27 | mq2.begin();
| ^~~
C:\Users\User\OneDrive\Documents\Arduino\coding-2\coding-2\coding-2.ino: In function 'void notification()':
C:\Users\User\OneDrive\Documents\Arduino\coding-2\coding-2\coding-2.ino:42:13: error: 'mq2' was not declared in this scope
42 | float t = mq2.readTemperature();
| ^~~
exit status 1
Compilation error: 'mq2' was not declared in this scope
C:\Users\User\OneDrive\Documents\Arduino\coding-2\coding-2\coding-2.ino: In function 'void notification()':
C:\Users\User\OneDrive\Documents\Arduino\coding-2\coding-2\coding-2.ino:43:15: error: 'class MQ2' has no member named 'readTemperature'
43 | float t = mq2.readTemperature();
| ^~~~~~~~~~~~~~~
exit status 1
Compilation error: 'class MQ2' has no member named 'readTemperature'```
I managed to connect to wifi and also to the blynk cloud.
But I can't trigger the gas concentration value. I don't know if there are something wrong with the code or something else because i can verify and compile the code.