Advertisement
Guest User

state burp

a guest
Feb 19th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. int pressurePinOne = A0;  
  2. int fireOne = false;
  3.  
  4. void setup() {
  5.   Serial.begin(9600);
  6. }
  7.  
  8. void loop() {
  9.   // read the value from the sensor:
  10.   int pressureOne = analogRead(pressurePinOne);
  11.  
  12.   if(pressureOne > 1000 && !fireOne){
  13.     fireOne = true;
  14.   }
  15.  
  16.   if(fireOne){
  17.     // jeebus, just send this ONLY ONCE.
  18.     Serial.println("fireOne");
  19.     if(pressureOne < 1000 && fireOne){
  20.         fireOne = false;
  21.     }
  22.    
  23.   }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement