基于51单片机的硬币电子秤的实现
代码说明:
这是基于51单片机的硬币电子秤的实现,内含C语言源码和proteus仿真实现 【源码目录】 硬币电子秤的实现 ├── 1Kg电子秤程序(LCD1602显示)│ ├── HX711.H│ ├── HX711.LST│ ├── HX711.OBJ│ ├── HX711.c│ ├── LCD1602.LST│ ├── LCD1602.OBJ│ ├── LCD1602.c│ ├── LCD1602.h│ ├── MAIN.H│ ├── lcd12864.LST│ ├── lcd12864.OBJ│ ├── lcd12864.c│ ├── lcd12864.h│ ├── main│ ├── main.LST│ ├── main.M51│ ├── main.OBJ│ ├── main.c│ ├── main.hex│ ├── main.lnp│ ├── main.plg│ ├── main.uvgui.Administrator│ ├── main.uvgui.Cai Chao│ ├── main.uvgui_Administrator.bak│ ├── main.uvgui_Cai Chao.bak│ ├── main.uvopt│ ├── main.uvproj│ ├── main_uvopt.bak│ ├── main_uvproj.bak│ ├── uart.LST│ ├── uart.OBJ│ ├── uart.c│ └── uart.h├── HX711模块加载文件│ └── HX711.hex├── Last Loaded 电子秤实现3.fv8.5.pdsbak├── Last Loaded 电子秤实现3.pdsbak├── 电子秤实现3.pdsprj├── 电子秤实现3.pdsprj.DESKTOP-SC10NBS.zxh.workspace└── 电子秤实现3.pdsprj.LAPTOP-KPK9NO8B.浪峰姐姐.workspace2 directories, 39 files【核心代码】void main(){ Uart_Init(); Send_Word("Weight"); Send_Word("Num"); Init_LCD1602(); LCD1602_write_com(0x80); LCD1602_write_word("Weight"); LCD1602_write_com(0x80 7); LCD1602_write_word("Num"); Delay_ms(1000); //ÑÓʱ,µÈ´ý´«¸ÐÆ÷Îȶ¨ Get_Maopi(); //³ÆëƤÖØÁ¿ while(1) { EA = 0; Get_Weight(); //³ÆÖØ Number = Weight_Shiwu/(coin_weight*10); EA = 1; Scan_Key(); //ÏÔʾµ±Ç°ÖØÁ¿ if( Flag_ERROR == 1) { Send_Word("ERROR"); LCD1602_write_com(0x80 0x40); LCD1602_write_word("ERROR "); } else { Send_ASCII(Weight_Shiwu/1000 0X30); Send_ASCII(Weight_Shiwu%1000/100 0X30); Send_ASCII(Weight_Shiwu%100/10 0X30); Send_Word("."); Send_ASCII(Weight_Shiwu%10 0X30); Send_Word("g"); LCD1602_write_com(0x80 0x40); LCD1602_write_data(Weight_Shiwu/1000 0X30); LCD1602_write_data(Weight_Shiwu%1000/100 0X30); LCD1602_write_data(Weight_Shiwu%100/10 0X30); LCD1602_write_word("."); LCD1602_write_data(Weight_Shiwu%10 0X30); LCD1602_write_word("g"); Send_ASCII(Number/100 0x30); Send_ASCII(Number%100/10 0x30); Send_ASCII(Number%10 0x30); LCD1602_write_com(0x80 0x40 7); LCD1602_write_data(Number/100 0x30); LCD1602_write_data(Number%100/10 0x30); LCD1602_write_data(Number%10 0x30); Send_ASCII(coin/10 0x30); Send_ASCII(coin%10 0x30); Send_Word("jiao"); LCD1602_write_com(0x80 12); LCD1602_write_data(coin/10 0x30); LCD1602_write_data(coin%10 0x30); LCD1602_write_com(0x80 0x40 12); LCD1602_write_word("jiao"); } }}
下载说明:请别用迅雷下载,失败请重下,重下不扣分!