完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
#include
***it ADDR0 = P1^0; ***it ADDR1 = P1^1; ***it ADDR2 = P1^2; ***it ADDR3 = P1^3; ***it ENLED = P1^4; typedef unsigned int uint16; typedef unsigned char uint8; typedef unsigned long uint32; uint8 l,h,f,d; code uint8 dx[]={0xFF,0x99,0x00,0x00,0x00,0x81,0xC3,0xE7,0xff}; code uint8 xx[]={0xFF,0xFF,0xDB,0x81,0x81,0xC3,0xE7,0xFF}; code uint16 zz[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xa7,0xa1,0x86,0x8e}; //------ÑÓʱ-------- ys(uint16 a) { static uint16 i,j; for(i=0;i for(j=0;j<50;j++){ } } } //------LEDµÆ------- led8() { ADDR3 = 1; ENLED = 0; ADDR0 = 0; ADDR1 = 1; ADDR2 = 1; } //------ÊýÂë¹Ü------ leds() { ADDR3 = 1; ENLED = 0; } //------LEDX-------- ledx() { ADDR3 = 0; ENLED = 0; } //-------------´óÐÄÉÁ--------- dxf(uint8 a){ static uint8 K = 0; if(K == 0){ADDR0 = 0;ADDR1 = 0;ADDR2 = 0;P0 = dx[K];K++;};ys(a); if(K == 1){ADDR0 = 1;ADDR1 = 0;ADDR2 = 0;P0 = dx[K];K++;};ys(a); if(K == 2){ADDR0 = 0;ADDR1 = 1;ADDR2 = 0;P0 = dx[K];K++;};ys(a); if(K == 3){ADDR0 = 1;ADDR1 = 1;ADDR2 = 0;P0 = dx[K];K++;};ys(a); if(K == 4){ADDR0 = 0;ADDR1 = 0;ADDR2 = 1;P0 = dx[K];K++;};ys(a); if(K == 5){ADDR0 = 1;ADDR1 = 0;ADDR2 = 1;P0 = dx[K];K++;};ys(a); if(K == 6){ADDR0 = 0;ADDR1 = 1;ADDR2 = 1;P0 = dx[K];K++;};ys(a); if(K == 7){ADDR0 = 1;ADDR1 = 1;ADDR2 = 1;P0 = dx[K];K=0;};ys(a); } //------------ÎÞÐÄÉÁ---------- wxf(uint8 a,uint8 b){ static uint8 K = 0; if(K == 0){ADDR0 = 0;ADDR1 = 0;ADDR2 = 0;P0 = dx[b];K++;};ys(a); if(K == 1){ADDR0 = 1;ADDR1 = 0;ADDR2 = 0;P0 = dx[b];K++;};ys(a); if(K == 2){ADDR0 = 0;ADDR1 = 1;ADDR2 = 0;P0 = dx[b];K++;};ys(a); if(K == 3){ADDR0 = 1;ADDR1 = 1;ADDR2 = 0;P0 = dx[b];K++;};ys(a); if(K == 4){ADDR0 = 0;ADDR1 = 0;ADDR2 = 1;P0 = dx[b];K++;};ys(a); if(K == 5){ADDR0 = 1;ADDR1 = 0;ADDR2 = 1;P0 = dx[b];K++;};ys(a); if(K == 6){ADDR0 = 0;ADDR1 = 1;ADDR2 = 1;P0 = dx[b];K++;};ys(a); if(K == 7){ADDR0 = 1;ADDR1 = 1;ADDR2 = 1;P0 = dx[b];K=0;};ys(a); } //-------СÐÄÉÁ----------- xxf(uint8 a){ static uint8 K = 0; if(K == 0){ADDR0 = 0;ADDR1 = 0;ADDR2 = 0;P0 = xx[K];K++;};ys(a); if(K == 1){ADDR0 = 1;ADDR1 = 0;ADDR2 = 0;P0 = xx[K];K++;};ys(a); if(K == 2){ADDR0 = 0;ADDR1 = 1;ADDR2 = 0;P0 = xx[K];K++;};ys(a); if(K == 3){ADDR0 = 1;ADDR1 = 1;ADDR2 = 0;P0 = xx[K];K++;};ys(a); if(K == 4){ADDR0 = 0;ADDR1 = 0;ADDR2 = 1;P0 = xx[K];K++;};ys(a); if(K == 5){ADDR0 = 1;ADDR1 = 0;ADDR2 = 1;P0 = xx[K];K++;};ys(a); if(K == 6){ADDR0 = 0;ADDR1 = 1;ADDR2 = 1;P0 = xx[K];K++;};ys(a); if(K == 7){ADDR0 = 1;ADDR1 = 1;ADDR2 = 1;P0 = xx[K];K=0;};ys(a); } //--------Ðĵçͼ----------- xdt(){ P0 = 0xfe;ys(3); P0 = 0xfd;ys(3); P0 = 0xfb;ys(3); P0 = 0xf7;ys(100); P0 = 0xef;ys(3); P0 = 0xdf;ys(3); P0 = 0xbf;ys(3); P0 = 0x7f;ys(3); } //------------Ö÷º¯Êý------------------------- main(){ ledx(); while(1){ ledx(); for(l=0;l<10;l++){ xxf(10); } for(h=0;h<5;h++){ dxf(5); } led8(); xdt(); ledx(); for(h=0;h<5;h++){ dxf(5); } for(f=0;f<10;f++){ xxf(10); } } } |
|
相关推荐
1个回答
|
|
支持一个,顶顶顶
|
|
|
|
只有小组成员才能发言,加入小组>>
479个成员聚集在这个小组
加入小组5099 浏览 1 评论
12122 浏览 5 评论
3504 浏览 2 评论
2972 浏览 0 评论
12704 浏览 2 评论
w5500 作为tcp server,客户端异常发送【RST,ACK】断开连接问题
1670浏览 1评论
1089浏览 0评论
使用stm32,通过spi的dma 收发,运行多次读写以后w5500发送正常,接收卡死,高人帮忙看看
6300浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 00:58 , Processed in 0.381940 second(s), Total 50, Slave 40 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号