Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <MQ2.h>
- int pinAout = A0;
- int lpg_gas, co_gas, smoke_gas;
- MQ2 mq2(pinAout);
- void setup() {
- Serial.begin(9600);
- mq2.begin();
- // put your setup code here, to run once:
- }
- void loop() {
- float* values=mq2.read(true);
- lpg_gas = mq2.readLPG();
- co_gas = mq2.readCO();
- smoke_gas = mq2.readSmoke();
- delay(1000);
- // put your main code here, to run repeatedly:
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement