if(flag5==1) //motor reverse
{
U2=1;
U3=0;
}
}
void qbiaozhun() //Strong standard
{
/*******washing********/
num=0;
num1=0;
ledbiaozhun=0; //Standard LED light
ledqiangxi=0; //Strong wash LED on
jinshui=0; //Open the water inlet valve
ledxidi=1; //washing
ledpiaoxi=1; //Rinse LED on
ledtuoshui=1; //Dehydration LED is on
delayms(5000); //water level monitoring
jinshui=1; //Close the water inlet valve
ledxidi=0;
flag1=1; //
TR0=1; //Start timer T0
while(flag==0) //flag is the washing times flag
{
if(flag==0&&num2==1)
{
TR0=1;
flag1=1; //
qiang();
}
if(flag==0&&num2==2)
{
TR0=0; //Turn off timer T0
U2=1; //Motor stops
U3=1;
}
};
//rinsing
U2=1;
U3=1;
TR0=0;
flag1=0;
paishui=0; //drainage
ledtuoshui=1;
ledpiaoxi=1;
ledxidi=1;
delayms(5000);
paishui=1; //Close drainage
delayms(100);
jinshui=0; //Open water inlet
delayms(5000);
jinshui=1; //Close water inlet
ledpiaoxi=0;
flag1=2;
TR0=1;
num3=0;
num4=0;
while(flag==1)
{
if(flag==1&&num2==1)//Strong rinse
{
TR0=1;
flag1=2;
qiang();
}
if(flag==1&&num2==2)//Pause strong rinse
{
TR0=0;
U2=1;
U3=1;
}
};
//rinsing
U2=1;
U3=1;
TR0=0;
flag1=0;
paishui=0;
ledtuoshui=1;
ledpiaoxi=0;
delayms(5000);
paishui=1;
delayms(100);
jinshui=0;
delayms(5000);
jinshui=1;
flag1=2;
TR0=1;
num3=0;
num4=0;
while(flag==2)
{
if(flag==2&&num2==1)
{
TR0=1;
flag1=2;
qiang();
}
if(flag==2&&num2==2)
{
TR0=0;
U2=1;
U3=1;
}
} ;
//Dehydration
U2=1;
U3=1;
TR0=0;
flag1=0;
paishui=0; //Open drainage
ledtuoshui=0;
ledpiaoxi=1;
while(sgai);
paishui=1;
delayms(1000);
flag1=3;
TR0=1;
num3=0;
num4=0;
while(flag==3)
{
if(flag==3&&num2==1)
{
TR0=1;
U2=0;
U3=1;
flag1=3;
}
if(flag==3&&num2==2)
{
TR0=0;
U2=1;
U3=1;
}
};
ledtuoshui=1;
U2=1;
U3=1;
flag1=0;
}
void qjingji() //Strong economy
{
/*******washing********/
num=0;
num1=0;
ledjingji=0;
ledqiangxi=0;
ledtuoshui=1;
ledpiaoxi=1;
ledxidi=1;
jinshui=0;
delayms(5000);
jinshui=1;
flag1=1; //Control the washing indicator light in the timer
TR0=1;
while(flag==0)
{
if(flag==0&&num2==1)
{
TR0=1;
flag1=1;
qiang();
}
if(flag==0&&num2==2)
{
TR0=0;
U2=1;
U3=1;
}
};
//rinsing
TR0=0;
U2=1;
U3=1;
flag1=0;
paishui=0;
ledjingji=0;
ledtuoshui=1;
ledxidi=1;
delayms(5000);
paishui=1;
delayms(100);
jinshui=0;
delayms(5000);
jinshui=1;
ledpiaoxi=0;
flag1=2;
TR0=1;
num3=0;
num4=0;
while(flag==1)
{
if(flag==1&&num2==1)
{
TR0=1;
flag1=2;
qiang();
}
if(flag==1&&num2==2)
{
TR0=0;
U2=1;
U3=1;
}
};
//Dehydration
TR0=0;
U2=1;
U3=1;
flag1=0;
paishui=0; //Open drainage
ledjingji=0;
ledtuoshui=0;
ledpiaoxi=1;
delayms(5000);
while(sgai);
paishui=1;
delayms(1000);
flag1=3;
TR0=1;
flag=2;
num3=0;
num4=0;
while(flag==2)
{
if(flag==2&&num2==1)
{
TR0=1;
U2=0;
U3=1;
flag1=3;
}
if(flag==2&&num2==2)
{
TR0=0;
U2=1;
U3=1;
}
};
ledtuoshui=1;
U2=1;
U3=1;
flag1=0;
}
void qdandu() //Strong single
{
num=0;
num1=0;
ledqiangxi=0;
ledxidi=0;
leddandu=0;
jinshui=0;
delayms(5000);
jinshui=1; //Close the water inlet valve
flag1=1;
TR0=1;
while(flag==0)
{
if(flag==0&&num2==1)
Previous article:Simulation and Program of Stepper Motor Controlled by STC89C52RC MCU
Next article:MCU + ADC0832 simple digital voltmeter proteus simulation and program source code
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- What will happen if the servo motor inertia is insufficient?
- How to select parameters for servo motor inertia size
- The difference between the servo motor moment of inertia and the load moment of inertia
- How to calculate the inertia of servo motor and reducer
- What is the difference between a servo press and a normal press?
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- TMS320F28335 general purpose input/output port GPIO related register introduction
- On-line debugging method for embedded processors
- "Qinheng Evaluation Board Sincerely Send" Activity Q&A Post
- The problem with "LTE Cat 1"
- Has anyone used the Raspberry Pi Cm3+?
- Synchronization technology in digital communication: frame synchronization, carrier synchronization, bit synchronization
- Bone conduction headphone op amp
- [Open Source] Development Interface Connection Tutorial - Crazy Shell ARM Dual Processor Development Board Series
- [Atria AT32WB415 Review] 3. Serial port print information printf
- [GD32L233C] + 3. Use RTThread