This ultrasonic water level measurement and control system C language source program involves almost all the professional courses learned, such as single-chip microcomputers, automatic control principles, digital circuits, analog circuits, circuit analysis, software technology, intelligent detection and conversion technology, etc., which well reflects the requirements of comprehensive training. This electronic small production design belongs to a complete system. There are many factors to consider in the design process, but the design function is relatively simple and there will not be too much difficulty. The difficulty of the topic is moderate. It can not only consolidate the knowledge and skills learned, but also improve them. Compared with other topics, this topic has relatively more information and it is relatively easy to search for information. But for undergraduates, it is also difficult to choose the most suitable information from a large number of materials of varying quality. The ultrasonic water level measurement and control system C language source program is a good exercise for design students.
//Ultrasonic water level measurement and control system C language source program
#include
#define uchar unsigned char
#define uint
sbit Trig=P1^0;sbit Echo=P3^2;
sbit lcden=P0^4;
sbit lcdrs=P0^1;
sbit alertl=P1^1;//Low water level alarm, red light is on
sbit alertm=P1^7;//Middle water level green light is on
sbit alerth=P1^4;//High water level alarm, yellow light is on
sbit pumb=P0^2;//low vol is avalibal sbit
power=P3^5;
uint time,distance,waterlevel;
uchar timeH,timeL;
bit succeed_flag;
void delay(uint z);
//Ultrasonic water level measurement and control system C language source program Electronic small production
void init()
{
}
//****************************************************************** void delay(uint z) { uint x,y; for(x=z;x>0;x--) for (y=110;y>0;y--); } //************************************************************************************************************************************************************************************************************ void
delay(uint z)
{
//***************************************************************
void display1()
{
uchar code table[]="SIAS UNIVERSITY ";
uchar code table1[]="ZZS 20071521258 ";
uchar num;
write_com(0x80);
for(num=0;num<16;num++)
write_com(0x80+0x40);
for(num=0;num<16;num++)
write_com(0x01);
delay(1000);
}
//*******************************************************************
//***************************************************************
//External interrupt 0, used to judge the echo level //Ultrasonic water level measurement control system C language source program
void exter()
}
//******************************************************************
Previous article:A simple single-chip traffic light program
Next article:Ultrasonic distance measurement program using 18B20 for temperature compensation
- Popular Resources
- Popular amplifiers
Recommended Content
Latest Microcontroller Articles
- 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)
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- 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
MoreDaily News
- 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
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
Guess you like
- Essential for EMC Electronic Engineers
- Can you help me take a look at this FPGA development board?
- FLUKE is hiring!
- FPGA realizes digital tube counting
- MSP430FW42X Non-Magnetic Sensor Water Meter Solution
- Error handling in C programming for embedded systems
- How to Redefine the Size of Information Memory and Persistent Memory in FRAM
- Add instructions about littlefs in MicroPython's uos documentation
- Selling Zedboard Zynq7020 development board
- Calibration of medical devices