[Resource Download] The download address is as follows:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl
51 single chip microcomputer automatic feeding machine design-L298N-vibration-key-LCD1602
The design is composed of STC89C52 single-chip circuit + L298N motor drive circuit + vibration sensor module circuit + button circuit + LCD1602 liquid crystal display circuit + power supply circuit.
1. Press button 1, motor 1 starts, and the LCD displays: Importing. When the vibration sensor detects the vibration, the motor 1 stops rotating, and at the same time, the LCD displays: End of feed.
2. Press button 2 to set the time for motor 2 to rotate, which is 5 seconds or 10 seconds. After pressing the button 3, the motor 2 starts and the LCD displays: Exporting. When the time is up, the motor stops rotating and the LCD displays: End of material.
3. The LCD displays the countdown time of motor 2 rotation.
4. After the system is powered on, the LCD display: Charger system.
char dis0[16]; //打印数组初始化
char dis1[16]; //打印数组初始化
unsigned char pwmRigh=1; //pwm调整
unsigned char pwmLeft=1;
bit timeFlag = 0;
static bit rekey =0;//防止重复按下
unsigned int timeLater =0;//延时
void Init_Timer0(void);
void main (void)
{
ENA = 0;
ENB = 0;
Init_Timer0(); //定时器0初始化
DelayMs(10); //延时有助于稳定
LCD_Init(); //初始化液晶
DelayMs(20); //延时有助于稳定
LCD_Clear();