单片机控制数码管循环显示0-9程序,想问一下哪里出错了

#include<reg52.h>#define uint unsigned int#define uchar unsigned charvoid main(){ P0=255; uint t=0; uchar table[] = {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71}; while(1) { if(t==10) t=0; P0=num[t]; delayms(1000); t++; }}延迟函数没有问题,报错说是在uint t=0;前后有语法错误,请大家指教,谢谢
2026年09月19日 09:09
有2个网友回答
网友(1):

P0=255;这行挪到while(1)前面试试

网友(2):

P0 = num[t];
改为
P0 = table[t];//试试看