LcdWriteData('0'+datas[0]); //Hundreds digit
//LcdWriteData('2');
LcdWriteCom(0x82+0x40); //Write address 80 indicates the initial address
LcdWriteData('0'+datas[1]); //ten digits
//LcdWriteData('2');
LcdWriteCom(0x83+0x40); //Write address 80 indicates the initial address
LcdWriteData('0'+datas[2]); //unit
LcdWriteCom(0x84+0x40); //Write address 80 indicates the initial address
LcdWriteData('0'+datas[3]); //
LcdWriteCom(0x85+0x40); //Write address 80 indicates the initial address
LcdWriteData('0'+datas[4]); //Display decimal point
LcdWriteCom(0x86+0x40); //Write address 80 indicates the initial address
LcdWriteData('0'+datas[5]); //Display decimal point
}
/*******************************************************************************
* Function name: TDSDisplay()
* Function: Calculate TDS value
* Input: Temperature
* Output: None
*******************************************************************************/
long caculate_TDS(float temp)
{
unsigned long TDS;
float Kt=0;
double Ks=0;
Ks=0.0324*count;
//Kt=1000000/count;
temp=temp*0.0625*100+0.5;
//temp=temp/100+(int)temp%100*0.01;
if(temp<10&&temp>=1)
{
Kt=Ks*(0.00169*temp+0.5583);
}
else if(temp<20&&temp>=10)
{Kt=Ks*(0.018*temp+0.5473);
}
else if(temp<30&&temp>=20)
{Kt=Ks*(0.00189*temp+0.5281);
}
else
{ Kt=Ks*(0.022*temp+0.45);
}
TDS=0.55*Kt;
return Ks;
}
/*******************************************************************************
* Function name definition: PutString()
* Description: Send a string
*******************************************************************************/
void PutString(unsigned char *TXStr)
{
while(*TXStr!=0)
{
SBUF=*TXStr;
while(TI==0);
TI = 0;
TXStr++;
}
}
/*******************************************************************************
* Function name definition: send()
* Description: Send measured temperature, TDS
*******************************************************************************/
void send()
{
unsigned int shi,gewei,TD1,testno,testnoshi,testnoge;
unsigned int NO[6];
unsigned int i ,x;
unsigned int TD[8];
char str1[5];
unsigned int TE[8];
if(key==0)
{
while(!key);
test++;
testnoshi=testno/10;
testnoge=testno%10;
NO[0]='N';
NOT[1]='O';
NO[2]=':';
NO[3]=testnoshi+0x30;
NO[4]=test legs+0x30;
NO[5]='n';
for(x=0;x<6;x++)
{
SBUF =NO[x];
while(!IF);
IF = 0;
}
str1[0]='n';
str1[1]='T';
str1[2]='D';
str1[3]='S';
str1[4]='=';
for(x=1;x<5;x++)//??揟DS=?
{
SBUF = str1[x];
……………………
Previous article:51 MCU Basic Calculator
Next article:Four-way buzzer based on Puzhong Technology 51 single-chip microcomputer
Recommended ReadingLatest update time:2024-11-15 18:46
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
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
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Sandia Labs develops battery failure early warning technology to detect battery failures faster
- Ranking of installed capacity of smart driving suppliers from January to September 2024: Rise of independent manufacturers and strong growth of LiDAR market
- Industry first! Xiaopeng announces P7 car chip crowdfunding is completed: upgraded to Snapdragon 8295, fluency doubled
- P22-009_Butterfly E3106 Cord Board Solution
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- How complicated is the inside of a sweeping robot? TI E2E will reveal the secrets for you in five steps! Answer the questions and win prizes...
- Keil newly built project, why can't I find ADuC7029
- [Fudan Micro FM33LG0 Series Development Board Evaluation] Development Board Hardware Evaluation, CMSIS-DAP Download Test
- 【Development Kit for nRF52840】+ Three Tools for Evaluation & Cloud Gateway Testing
- What is carrier bandwidth in wireless communications?
- [HC32F460 Development Board Review] 09. Implementing read and write operations on W25Q64 through hardware QSPI
- What is DC coupling & AC coupling?
- How to test power integrity?
- CC3200 kit OURS-SDK-WFB_Exploration 3 - FreeRTOS porting failed
- Participate to get gifts | Welcome to Tektronix High Speed Serial Knowledge Planet