只需一步,快速開始
熱門: 51單片機(jī) | 24小時(shí)必答區(qū) | 單片機(jī)教程 | 單片機(jī)DIY制作 | STM32 | Cortex M3 | 模數(shù)電子 | 電子DIY制作 | 音響/功放 | 拆機(jī)樂園 | Arduino | 嵌入式OS | 程序設(shè)計(jì)
使用道具 舉報(bào)
非常感謝,我是初學(xué)單片機(jī)很多地方都不是很明白。希望能和各位師傅們常交流!!
#include<reg51.h>
少了上面這個(gè)頭文件!
你是要做跑馬燈吧
我在你的程序上修改了下:
#include<intrins.h>
#define uint unsigned int#define uchar unsigned charuchar temp;void delay();void main(){ temp=0xfe; P1=temp; while(1) { temp= _crol_ (temp,1); delay(); P1=temp; }}void delay(){ uint x,y; for(x=100;x>0;x--) for(y=100;y>0;y--);}運(yùn)行過的,可以用的。
我就不知道自己錯在哪里這么回事呀!!
希望大師傅們教我!!
#define uint unsigned int#define uchar unsigned charuchar temp;void delay();void main(){ while(1) temp=0xfe; P1=temp; { temp= _crol_ (temp,1); delay(); P1=temp; }}void delay(){ uint x,y; for(x=100;x>0;x--) for(y=100;y>0;y--);}
本版積分規(guī)則 發(fā)表回復(fù)
小黑屋|51黑電子論壇 | 管理員QQ:125739409;技術(shù)交流QQ群281945664
Powered by 單片機(jī)教程網(wǎng)