Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int triggerPin = 8;
- const int motorPin = 13;
- const int cutoffPin = 9;
- const int savePin = 10;
- int var = 0;
- int var2 = 0;
- int triggerPin1 = 0;
- int cutoffPin1 = 0;
- int savePin1 = 0;
- void setup() {
- pinMode(motorPin, OUTPUT);
- pinMode(triggerPin, INPUT);
- pinMode(cutoffPin, INPUT);
- pinMode(savePin, INPUT);
- Serial.begin(9600);
- }
- void loop() {
- triggerPin1 = digitalRead(triggerPin);
- cutoffPin1 = digitalRead(cutoffPin);
- savePin1 = digitalRead(savePin);
- if (savePin1 == LOW){
- if (triggerPin1 == HIGH){
- digitalWrite(motorPin, HIGH);
- while(digitalRead(cutoffPin) == LOW) {
- Serial.println("Waiting for CutOff...");
- }
- digitalWrite(motorPin, LOW);
- while(digitalRead(triggerPin) == LOW) {
- Serial.println("Wait for trigger release...");
- }
- }
- }
- Serial.print(var);
- Serial.print(var2);
- Serial.print(savePin1);
- Serial.println("____________");
- delay(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment