完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
本帖最后由 eehome 于 2013-1-5 10:06 编辑
#include #define uchar unsigned char #define uint unsigned int ***it duan=P2^2; ***it wei=P2^3; unsigned char code dofly_DuanMa[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; unsigned char code dofly_WeiMa[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f}; uint count=0; bit flag=1 ; void Delay_ms(uint xms) { uint i, j; for(i=xms;i>0;i--) for(j=115;j>0;j--); } void main() { while(1) { uchar i,j,k ; if(flag==1) count++; if(count>999) count=0; for(j=0;j<9;j++) { P0=dofly_WeiMa[j]; wei=1; wei=0; Delay_ms(1000); } for(k=0;k<11;k++) { P0=dofly_WeiMa[k]; duan=1; duan=0; Delay_ms(1000); } } } |
|
|
相关推荐
|
|
|
" if(flag==1)
count++; if(count>999) count=0; "这个是用来做什么的,你这个显示也不对,数码管是几位的,只有两位是不? |
|
|
|
|
|
|
|
|
本帖最后由 小路风声 于 2012-8-12 21:32 编辑
for(j=0;j<9;j++) { P0=dofly_WeiMa[j]; wei=1; wei=0; Delay_ms(1000); } for(k=0;k<11;k++) { P0=dofly_WeiMa[k]; duan=1; duan=0; Delay_ms(1000); 你的这段程序是要等位选执行完了才会执行段选信号啊,实际上就相当于P0=dofly_WeiMa[7]; duan=1; duan=0; Delay_ms(1000); 这一条命令啊。 还有你的j、K上限也不对吧?j<8,k<10.(0~7刚好8个数,0~9刚好10个数) |
|
|
|
|
|
|
|
|
本帖最后由 小路风声 于 2012-8-12 21:35 编辑
还有你的count不知道干啥用的,是加到999,数码管显示一次吗?如果是那样应该是 if(flag==1) count++; if(count==999) { count=0 …… } |
|
|
|
|
|
|
|
【瑞萨RA6E2】瑞萨E2S软件安装过程,等待过程玩下97_e2 studio_ZGZZ
234 浏览 0 评论
514 浏览 0 评论
【原创】【RA4M2-SENSOR开发板评测】低功耗+USB综合测试
826 浏览 0 评论
1366 浏览 2 评论
814 浏览 0 评论
【youyeetoo X1 windows 开发板体验】少儿AI智能STEAM积木平台
16911 浏览 31 评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-3 02:39 , Processed in 1.005736 second(s), Total 77, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖