247
edits
No edit summary  | 
				|||
| Line 28: | Line 28: | ||
   setup() {  |    setup() {  | ||
   // put your setup code here, to run once:  |    // put your setup code here, to run once:  | ||
  pinMode(pump_in, OUTPUT); // declare pin as output pin  | |||
  pinMode(pump_out, OUTPUT); // declare pin as output pin  | |||
  Serial.begin(9800);  | |||
  }  | |||
  void   | |||
  loop() {  | |||
  // put your main code here, to run repeatedly:  | |||
  analogWrite(pump_out,  | |||
  0); // turn off the pump  | |||
  // make a for loop in order top blow up the balloon while ramping the motor  | |||
Serial.  |   for (int i =  | ||
  60; i <   | |||
  255; i++) {  | |||
  analogWrite(pump_in, i); // turn on the pump_in pin with value "i"  | |||
  delay(50); // wait for 50 milliseconds  | |||
  //Serial.println(i); // print the value of i  | |||
  }  | |||
  analogWrite(pump_in,   | |||
  0); // turn off the pump  | |||
  // delay: wait for some time  | |||
  delay(1000); // wait for one second  | |||
  // enter an eternal loop for prototyping  | |||
  // here will be a for loop for sucking out the air again  | |||
  // while (1) {}  | |||
  analogWrite(pump_in,   | |||
  0); // turn off the pump  | |||
  // make a for loop in order top blow up the balloon while ramping the motor  | |||
  for (int i =  | |||
  255; i >   | |||
  60; i--) {  | |||
  analogWrite(pump_out, i); // turn on the pump_in pin with value "i"  | |||
  delay(50); // wait for 50 milliseconds  | |||
  //Serial.println(i); // print the value of i  | |||
  }  | |||
  analogWrite(pump_out,  | |||
  0); // turn off the pump  | |||
  // delay: wait for some time  | |||
  delay(1000); // wait for one second  | |||
  }  | |||
'''Materials'''  | '''Materials'''  | ||
edits