![]() |
skyp 發表于 2021-6-10 14:44 雖然別的地方還有好多問題,但你說的灰色就是沒接好線,實在搞不好總線,你就一根一根接總不會出你現在的問題啊。 |
不說你那總線標號,就你那3個 5 ,你那npn,你那7404,??????![]() |
npn 發表于 2021-6-10 13:24 請問我有的LED顯示屏為什么沒有引腳數字顯示呀,還有我有一個引腳不能連接總線了,之前還能連的。。。。 |
hhdsdy 發表于 2021-6-10 13:35 我是學生,不懂什么原理,只是會基本的步驟。。。按照網上搜的一個文檔照著畫的,結果錯了。。。 |
hhdsdy 發表于 2021-6-10 13:35 #include<reg52.h> #define uint unsigned int #define uchar unsigned char uchar code dantab[]={ 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x00,0x40} ; //0~9,+ -; uchar key; uint value=0; sbit W1=P2^0; sbit W2=P2^1; sbit W3=P2^2; sbit W4=P2^3; void delay1ms() { uchar t=25; while(t--); } void Display(uint num) { uchar temp1,temp2,temp3,temp4; temp1=num/1000; temp2=num%1000/100; temp3=num%100/10; temp4=num%10; P0=dantab[temp1]; W1=0; delay1ms(); W1=1; P0=dantab[temp2]; W2=0; delay1ms(); W2=1; P0=dantab[temp3]; W3=0; delay1ms(); W3=1; P0=dantab[temp4]; W4=0; delay1ms(); W4=1; } void scan() { key = 0x03 & P1; while(key==0x00) { key = 0x03 & P1;Display(value);} if(key==0x02) { while(key==0x02) {key = 0x03 & P1;Display(value);} while(key==0x03) {key = 0x03 & P1;Display(value);} while(key==0x01) { key = 0x03 & P1;Display(value); if(key==0x00) { value++; if(value==1001) { value=0; } Display(value); } } } if(key==0x01) { while(key==0x01) { key = 0x03 & P1;Display(value);} while(key==0x03) { key = 0x03 & P1;Display(value);} while(key==0x02) { key = 0x03 & P1;Display(value); if(key==0x00) { value--; if(value==-1) { value=1000; } Display(value); } } } } void main() { P1=0x00; EA=1; //CPU開中斷 EX0=1; //允許外部中斷0中斷 IT0=1; //邊沿觸發 while(1) scan(); } |
那個不叫灰色的引腳![]() |
導線要添加網絡標號,只有相同的網絡標號才是同一根線。![]() ![]() ![]() |