Advertisement
Guest User

latihan2

a guest
Oct 14th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <MQ2.h>
  2. int pinAout = A0;
  3. int lpg_gas, co_gas, smoke_gas;
  4. MQ2 mq2(pinAout);
  5. void setup() {
  6. Serial.begin(9600);
  7. mq2.begin();
  8. // put your setup code here, to run once:
  9.  
  10. }
  11.  
  12. void loop() {
  13. float* values=mq2.read(true);
  14. lpg_gas = mq2.readLPG();
  15. co_gas = mq2.readCO();
  16. smoke_gas = mq2.readSmoke();
  17. delay(1000);
  18. // put your main code here, to run repeatedly:
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement