標(biāo)題:
syntax error near 'unsigned', expected '__asm',這個錯誤怎么改啊
[打印本頁]
作者:
fighting_Ye
時間:
2023-4-12 09:08
標(biāo)題:
syntax error near 'unsigned', expected '__asm',這個錯誤怎么改啊
#include <reg52.h>
#include "1602.h"
#include "uart.h"
void SendData(void);//????????
void LCD_display(void);//LCD1602??????
void delay_ms(int xms)//????,1ms
{
unsigned char i;
for( ; xms > 0; xms--)
for(i = 110; i > 0; i--);
}
unsigned int Temperature = 0;//??????
void main()
{
RY1 = 0; RY2 = 0; //??????????
LCD1602_Init();//LCD1602???
uart_init(); //?????
//LCD1602???????????
LCD1602_Write_String(0, 1, "Temp:");
uchar m
;
static uchar n;
uint TC;
init_S();
TCA[0][3]=TCA[1][3]=TCA[2][3]=TCA[3][3]='.';//???
while(1)
{
STA44((m+1)%4); //?????????
if(STAbe(m,&TC)){ //?????????
TC=TC*0.625; //????
TCA[m][0]=TC/1000%10+'0'; //???ASCII?
TCA[m][1]=TC/100%10+'0';
TCA[m][2]=TC/10%10+'0';
TCA[m][4]=TC%10+'0';
}
m=(m+1)%(sizeof(TCA)/sizeof(TCA[0]));
if(count<60){
LedGreen=c0%20<10?OFF:ON; //???????
LedRed=OFF; count++;c0++; //???
}else {LedRed=ON; LedGreen=OFF;c0=0;}//???????
SendData();//???????
LCD_display();//LCD??
delay_ms(2000);//??2s,??????2?????
}
}
作者:
xuyaqi
時間:
2023-4-12 10:05
你在用 uchar 前應(yīng)先定義 #define unsigned char uchar;
作者:
li64331218
時間:
2023-4-12 10:28
沒定義就用肯定報錯啊
作者:
qsssuv
時間:
2023-4-12 10:34
變量的聲明得放在執(zhí)行語句的前面
作者:
Hephaestus
時間:
2023-4-12 17:23
qsssuv 發(fā)表于 2023-4-12 10:34
變量的聲明得放在執(zhí)行語句的前面
c99標(biāo)準(zhǔn)可以隨用隨定義,然而mdk支持c99但是c51不支持這個標(biāo)準(zhǔn)。
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1