MaLittlePwny

Untitled

Aug 25th, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.21 KB | None | 0 0
  1. const int triggerPin = 8;  
  2. const int motorPin = 13;
  3. const int cutoffPin = 9;  
  4. const int savePin = 10;
  5. int var = 0;
  6. int var2 = 0;
  7. int triggerPin1 = 0;
  8. int cutoffPin1 = 0;
  9. int savePin1 = 0;
  10.  
  11.  
  12. void setup() {
  13.  
  14.   pinMode(motorPin, OUTPUT);
  15.   pinMode(triggerPin, INPUT);
  16.   pinMode(cutoffPin, INPUT);
  17.   pinMode(savePin, INPUT);
  18.   Serial.begin(9600);
  19.  
  20. }
  21.  
  22. void loop() {
  23.  
  24. triggerPin1 = digitalRead(triggerPin);
  25. cutoffPin1  = digitalRead(cutoffPin);
  26. savePin1  = digitalRead(savePin);
  27.  
  28.  
  29.      if (savePin1 == LOW){
  30.      
  31.      
  32.      
  33.                          
  34.       if (triggerPin1 == HIGH){
  35.         digitalWrite(motorPin, HIGH);
  36.     while(digitalRead(cutoffPin) == LOW) {
  37.       Serial.println("Waiting for CutOff...");
  38.     }
  39.          
  40.          digitalWrite(motorPin, LOW);
  41.            
  42.      
  43.     while(digitalRead(triggerPin) == LOW) {
  44.       Serial.println("Wait for trigger release...");
  45.     }
  46.        
  47.      
  48.      
  49.      
  50.      
  51.      }  
  52. }
  53.     Serial.print(var);
  54.     Serial.print(var2);
  55.     Serial.print(savePin1);
  56.     Serial.println("____________");
  57.    
  58.   delay(1);
  59.                                                                                                              
  60.    
  61.  
  62. }
Advertisement
Add Comment
Please, Sign In to add comment