-
proteus仿真成功,实物搭建不能正常显示
程序仿真成功,但是用开发板搭建电路时显示失败,仔细检查过I/O口没有错误,LCD显示屏是可以正常显示其他代码的程序如下#include#include#includebitbdataflag_key;#include"main.h"#include"LCD1602.h"#include"HX711.h"#include"keyboard.h"#include"eeprom52.h"#defineucharunsignedchar#defineuintunsignedintunsignedlongHX711_Buffer=0;unsignedlongWeight_Maopi=0;unsignedlongWeight_Maopi_0=0;unsignedintqupi=0;longWeight_Shiwu=0;//键盘处理变量unsignedcharkeycode;unsignedcharDotPos;//小数点标志及位置uintGapValue,GapValue1;unsignedcharidataprice;//单价,长整型值,单位为分unsignedcharidatamoney;//总价,长整型值,单位为分//定义标识volatilebitFlagTest=0;//定时测试标志,每0.5秒置位,测完清0volatilebitFlagKeyPress=0;//有键按下标志,处理完毕清0//校准参数//因为不同的传感器特性曲线不是很一致,因此,每一个传感器需要矫正这里这个参数才能使测量值很准确。//当发现测试出来的重量偏大时,增加该数值。//如果测试出来的重量偏小时,减小改数值。//该值可以为小数//#defineGapValue349sbitLED=P1^1;volatilebitClearWeighFlag=0;//传感器调零标志位,清除0漂/******************把数据保存到单片机内部eeprom中******************/voidwrite_eeprom(){SectorErase(0x1000);GapValue1=GapValue&0x00ff;byte_write(0x2000,GapValue1);GapValue1=(GapValue&0xff00)>>8;byte_write(0x2001,GapValue1);byte_write(0x2060,a_a);}/******************把数据从单片机内部eeprom中读出来*****************/voidread_eeprom(){GapValue=byte_read(0x2001);GapValue=(GapValue=1000){LCD1602_write_com(0x80+0x40+6);LCD1602_write_data(money/1000+0x30);LCD1602_write_data(money%1000/100+0x30);LCD1602_write_data(money%100/10+0x30);LCD1602_write_data('.');LCD1602_write_data(money%10+0x
2023-03-27 0