fork download
  1. #include<LiquidCrystal.h>
  2. LiquidCrystal lcd(12,11,5,4,3,2);
  3. float value;
  4. int tmp = A1;
  5. int GAS_VAL = 0;
  6. void setup(){
  7. pinMode(tmp,INPUT);
  8. pinMode(A0,INPUT);
  9. pinMode(A2, INPUT);
  10. }
  11.  
  12. void loop(){
  13. value = analogRead(tmp)*0.004882814;
  14. value = (value - 0.5) * 100.0;
  15. lcd.setCursor(0,1);
  16. lcd.print("Tmp:");
  17. lcd.print(value);
  18. delay(1000);
  19. lcd.clear();
  20.  
  21. //MOTION
  22. lcd.setCursor(10,0);
  23. if((digitalRead(A0)) ==HIGH)
  24. {
  25.  
  26. lcd.print("Found");
  27. }
  28.  
  29. else
  30. {
  31. lcd.print("NoPIR");
  32. }
  33.  
  34.  
  35.  
  36. //Somke
  37. GAS_VAL = analogRead(A0);
  38. Serial.println(GAS_VAL);
  39. lcd.setCursor(10,0);
  40.  
  41. if (GAS_VAL >22.3)
  42. {
  43. lcd.setCursor(1,1);
  44. lcd.print("Detect ");
  45.  
  46. }
  47. else
  48. {
  49. lcd.setCursor(1,1);
  50. lcd.print("NOGas");
  51. Serial.println(GAS_VAL);
  52.  
  53. }
  54.  
  55. delay(1000);
  56. lcd.clear(); // Delay a little bit to improve simulation performance
  57. }// Wait for 1000 millisecond(s)
  58.  
  59.  
  60.  
Success #stdin #stdout #stderr 0.25s 39376KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error: unexpected symbol in "LiquidCrystal lcd"
Execution halted