C51 COMPILER V9.56.0.0 LIGHT 04/30/2022 20:06:41 PAGE 1 C51 COMPILER V9.56.0.0, COMPILATION OF MODULE LIGHT OBJECT MODULE PLACED IN Light.OBJ COMPILER INVOKED BY: D:\Keil_v5\C51\BIN\C51.EXE Light.c OPTIMIZE(8,SPEED) BROWSE DEBUG OBJECTEXTEND TABS(2) line level source 1 #ifndef __LIGHT_H_ 2 #define __LIGHT_H_ 3 4 #include 5 #include //Keil library 6 #include //Keil library 7 8 9 #define SlaveAddress 0x46 //定义器件在IIC总线中的从地址,根据ALT ADDRESS地址引脚不同修改 10 //ALT ADDRESS引脚接地时地址为0x46,接电源时地址为0xB8 11 12 13 sbit SCL=P1^0; //IIC时钟引脚定义 14 sbit SDA=P1^1; //IIC数据引脚定义 15 16 17 typedef unsigned short WORD; 18 19 unsigned char BUF[8]; //接收数据缓存区 20 21 int dis_data; //变量 22 23 void delay_nms(unsigned int k); 24 void InitLcd(); 25 void Init_BH1750(void); 26 void WriteDataLCM(uchar dataW); *** ERROR C141 IN LINE 26 OF Light.c: syntax error near 'dataW', expected ')' 27 void WriteCommandLCM(uchar CMD,uchar Attribc); *** ERROR C141 IN LINE 27 OF Light.c: syntax error near 'CMD', expected ')' 28 void DisplayOneChar(uchar X,uchar Y,uchar DData); *** ERROR C141 IN LINE 28 OF Light.c: syntax error near 'X', expected ')' 29 void conversion(uint temp_data); *** ERROR C141 IN LINE 29 OF Light.c: syntax error near 'temp_data', expected ')' 30 31 void Single_Write_BH1750(uchar REG_Address); //单个写入数据 *** ERROR C141 IN LINE 31 OF Light.c: syntax error near 'REG_Address', expected ')' 32 uchar Single_Read_BH1750(uchar REG_Address); //单个读取内部寄存器数据 *** ERROR C129 IN LINE 32 OF Light.c: missing ';' before 'Single_Read_BH1750' 33 void Multiple_Read_BH1750(); //连续的读取内部寄存器数据 34 //------------------------------------ 35 void Delay5us(); 36 void Delay5ms(); 37 void BH1750_Start(); //起始信号 38 void BH1750_Stop(); //停止信号 39 void BH1750_SendACK(bit ack); //应答ACK 40 bit BH1750_RecvACK(); //读ack 41 void BH1750_Sendunsigned char(unsigned char dat); //IIC单个字节写 42 unsigned char BH1750_Recvunsigned char(); //IIC单个字节读 43 44 45 //----------------------------------- 46 47 //********************************************************* 48 void conversion(uint temp_data) // 数据转换出 个,十,百,千,万 49 { C51 COMPILER V9.56.0.0 LIGHT 04/30/2022 20:06:41 PAGE 2 50 wan=temp_data/10000+0x30 ; 51 temp_data=temp_data%10000; //取余运算 52 qian=temp_data/1000+0x30 ; 53 temp_data=temp_data%1000; //取余运算 54 bai=temp_data/100+0x30; 55 temp_data=temp_data%100; //取余运算 56 shi=temp_data/10+0x30; 57 temp_data=temp_data%10; //取余运算 58 ge=temp_data+0x30; 59 } 60 61 //毫秒延时************************** 62 void delay_nms(unsigned int k) 63 { 64 unsigned int i,j; 65 for(i=0;i