#include <Servo.h>
//Create object
Servo servo_8;
Servo servo_9;
Servo servo_10;
//8-9-10 is the motherboard pin, 8 is for the air pump, and 9 is for the air pump. 10Insert the three-way solenoid valve. The pins can be customized according to your own needs, and any 2-13 pins on the motherboard can be inserted.
// Main program starts
void setup() {
servo_8.attach(8);
servo_9.attach(9);
servo_10.attach(10);
for (int index = 0; index < 3; index++) { //Note: Number of work cycles 0-? times cycle, which means cycle 3 times. 3 can be modified according to your own needs
servo_8.write(180);
servo_9.write(0);
servo_10.write(0);
delay(4000);
//----------------------------------------This group of codes indicates that the air pump is working 8 seconds (180 means on, 0 means off. delay(8000); means the running time is 8000 milliseconds. The inflation time can be customized and modified as needed.
servo_8.write(0);
servo_9.write(0);
servo_10.write(180);
delay(500);
//----------------------------------------This group of codes indicates that the solenoid valve is started, mainly solenoid priority Start for 0.5 seconds to prepare for the next step of pumping. This group of time basically does not need to be modified.
servo_8.write(0);
servo_9.write(180);
servo_10.write(180);
delay(4000);
//---------------------------------------This group of codes indicates that the air pump battery valve is working 8 seconds, which means pumping for 8 seconds (the time can be modified according to your needs).
servo_8.write(0);
servo_9.write(0);
servo_10.write(0);
//-------------------------------------All over.
}
}
void loop() {
}