久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 1831|回復: 0
收起左側

444光立方源程序

[復制鏈接]
ID:290483 發表于 2018-3-11 19:51 | 顯示全部樓層 |閱讀模式
#include<stdio.h>
#include<reg52.h>
#define uchar unsigned char
#define uint  unsigned int
/*****************************延時函數******************************/
void Delay(uint del)
{
        uint i,j;
        for(i=0; i<del; i++)
        for(j=0; j<18270; j++)   
        ;
}
/*******************************主函數*****************************/
main()
{
/***************群體閃爍********************/
P0=0XF0;
P1=0X00;
P2=0X00;
Delay(10);
P1=0XFF;
P2=0XFF;
Delay(10);
P1=0X00;
P2=0X00;
Delay(10);
P1=0XFF;
P2=0XFF;
Delay(10);
P1=0X00;
P2=0X00;
Delay(10);
P1=0XFF;
P2=0XFF;
Delay(10);
/*********************************列斷續掃描**************************/
P0=0X00;
P1=0X1;
P2=0X00;
Delay(10);/*1*/
P1=0X2;
P2=0X00;
Delay(10);/*2*/
P1=0X4;
P2=0X00;
Delay(10);/*3*/
P1=0X8;
P2=0X00;
Delay(10);/*4*/
P1=0X10;
P2=0X00;
Delay(10);/*5*/
P1=0X20;
P2=0X00;
Delay(10);/*6*/
P1=0X40;
P2=0X00;
Delay(10);/*7*/
P1=0X80;
P2=0X00;
Delay(10);/*8*/
P1=0X00;
P2=0X1;
Delay(10);/*9*/
P1=0X00;
P2=0X2;
Delay(10);/*10*/
P1=0X00;
P2=0X4;
Delay(10);/*11*/
P1=0X00;
P2=0X8;
Delay(10);/*12*/
P1=0X00;
P2=0X10;
Delay(10);/*13*/
P1=0X00;
P2=0X20;
Delay(10);/*14*/
P1=0X00;
P2=0X40;
Delay(10);/*15*/
P1=0X00;
P2=0X80;
Delay(10);/*16*/
P1=0X00;
P2=0X40;
Delay(10);/*15*/
P1=0X00;
P2=0X20;
Delay(10);/*14*/
P1=0X00;
P2=0X10;
Delay(10);/*13*/
P1=0X00;
P2=0X8;
Delay(10);/*12*/
P1=0X00;
P2=0X4;
Delay(10);/*11*/
P1=0X00;
P2=0X2;
Delay(10);/*10*/
P1=0X00;
P2=0X1;
Delay(10);/*9*/
P1=0X80;
P2=0X00;
Delay(10);/*8*/
P1=0X40;
P2=0X00;
Delay(10);/*7*/
P1=0X20;
P2=0X00;
Delay(10);/*6*/
P1=0X10;
P2=0X00;
Delay(10);/*5*/
P1=0X8;
P2=0X00;
Delay(10);/*4*/
P1=0X4;
P2=0X00;
Delay(10);/*3*/
P1=0X2;
P2=0X00;
Delay(10);/*2*/
P1=0X1;
P2=0X00;
Delay(10);/*1*/


/****************************************列平面掃描*************************************/
P1=0XF;
P2=0X00;
Delay(20);/*1*/
P1=0XF0;
P2=0X00;
Delay(20);/*2*/
P1=0X00;
P2=0XF;
Delay(20);/*3*/
P1=0X00;
P2=0XF0;
Delay(20);/*4*/
P1=0X00;
P2=0XF;
Delay(20);/*3*/
P1=0XF0;
P2=0X00;
Delay(20);/*2*/
P1=0XF;
P2=0X00;
Delay(20);/*1*/
/**********************************層掃描****************************/
P0=0XFE;
P1=0XFF;
P2=0XFF;
Delay(20);/*第1層(從下到上)*/
P0=0XFD;
P1=0XFF;
P2=0XFF;
Delay(20);/*第2層(從下到上)*/
P0=0XFB;
P1=0XFF;
P2=0XFF;
Delay(20);/*第3層(從下到上)*/
P0=0XF7;
P1=0XFF;
P2=0XFF;
Delay(20);/*第4層(從下到上)*/
P0=0XFB;
P1=0XFF;
P2=0XFF;
Delay(20);/*第3層(從下到上)*/
P0=0XFD;
P1=0XFF;
P2=0XFF;
Delay(20);/*第2層(從下到上)*/
P0=0XFE;
P1=0XFF;
P2=0XFF;
Delay(20);/*第1層(從下到上)*/
/*&*******************************層平面完畢******************************/
/***************群體閃爍********************/
P0=0XF0;
P1=0X00;
P2=0X00;
Delay(10);
P1=0XFF;
P2=0XFF;
Delay(10);
P1=0X00;
P2=0X00;
Delay(10);
P1=0XFF;
P2=0XFF;
Delay(10);
P1=0X00;
P2=0X00;
Delay(10);
P1=0XFF;
P2=0XFF;
Delay(10);
/*********************************列連續掃描*******************************/
P0=0X00;
P1=0X1;
P2=0X00;
Delay(10);/*1*/
P1=0X2;
P2=0X00;
Delay(10);/*2*/
P1=0X4;
P2=0X00;
Delay(10);/*3*/
P1=0X8;
P2=0X00;
Delay(10);/*4*/
P1=0X80;
P2=0X00;
Delay(10);/*8*/
P1=0X40;
P2=0X00;
Delay(10);/*7*/
P1=0X20;
P2=0X00;
Delay(10);/*6*/
P1=0X10;
P2=0X00;
Delay(10);/*5*/
P1=0X00;
P2=0X1;
Delay(10);/*9*/
P1=0X00;
P2=0X2;
Delay(10);/*10*/
P1=0X00;
P2=0X4;
Delay(10);/*11*/
P1=0X00;
P2=0X8;
Delay(10);/*12*/
P1=0X00;
P2=0X80;
Delay(10);/*16*/
P1=0X00;
P2=0X40;
Delay(10);/*15*/
P1=0X00;
P2=0X20;
Delay(10);/*14*/
P1=0X00;
P2=0X10;
Delay(10);/*13(返回開始)*/
P1=0X00;
P2=0X20;
Delay(10);/*14*/
P1=0X00;
P2=0X40;
Delay(10);/*15*/
P1=0X00;
P2=0X80;
Delay(10);/*16*/
P1=0X00;
P2=0X8;
Delay(10);/*12*/
P1=0X00;
P2=0X4;
Delay(10);/*11*/
P1=0X00;
P2=0X2;
Delay(10);/*10*/
P1=0X00;
P2=0X1;
Delay(10);/*9*/
P1=0X10;
P2=0X00;
Delay(10);/*5*/
P1=0X20;
P2=0X00;
Delay(10);/*6*/
P1=0X40;
P2=0X00;
Delay(10);/*7*/
P1=0X80;
P2=0X00;
Delay(10);/*8*/
P1=0X8;
P2=0X00;
Delay(10);/*4*/
P1=0X4;
P2=0X00;
Delay(10);/*3*/
P1=0X2;
P2=0X00;
Delay(10);/*2*/
P1=0X1;
P2=0X00;
Delay(10);/********1(完畢)****************/
/*****************逐點走*****************/
P0=0XFE;
P1=0X1;
P2=0X00;
Delay(10);/*1*/
P0=0XFE;
P1=0X2;
P2=0X00;
Delay(10);/*2*/
P0=0XFE;
P1=0X4;
P2=0X00;
Delay(10);/*3*/
P0=0XFE;
P1=0X8;
P2=0X00;
Delay(10);/*4*/
P0=0XFE;
P1=0X10;
P2=0X00;
Delay(10);/*5*/
P0=0XFE;
P1=0X20;
P2=0X00;
Delay(10);/*6*/
P0=0XFE;
P1=0X40;
P2=0X00;
Delay(10);/*7*/
P0=0XFE;
P1=0X80;
P2=0X00;
Delay(10);/*8*/
P0=0XFE;
P1=0X00;
P2=0X1;
Delay(10);/*9*/
P0=0XFE;
P1=0X00;
P2=0X2;
Delay(10);/*10*/
P0=0XFE;
P1=0X00;
P2=0X4;
Delay(10);/*11*/
P0=0XFE;
P1=0X00;
P2=0X8;
Delay(10);/*12*/
P0=0XFE;
P1=0X00;
P2=0X10;
Delay(10);/*13*/
P0=0XFE;
P1=0X00;
P2=0X20;
Delay(10);/*14*/
P0=0XFE;
P1=0X00;
P2=0X40;
Delay(10);/*15*/
P0=0XFE;
P1=0X00;
P2=0X80;
Delay(10);/*16*/
/*****************正方形放大縮小*********************/
P0=0XFC;
P1=0X00;
P2=0XCC;
Delay(100);/*小正方形*/
P0=0XF8;
P1=0XE0;
P2=0XEE;/*放大一倍*/
Delay(100);
P0=0XF0;
P1=0XFF;
P2=0XFF;
Delay(100);/*再次放大(全亮)*/
P0=0XF8;
P1=0XE0;
P2=0XEE;/*放大一倍*/
Delay(100);
P0=0XFC;
P1=0X00;
P2=0XCC;/*小正方形*/
Delay(200);
/***************群體閃爍********************/
P0=0XF0;
P1=0X00;
P2=0X00;
Delay(10);
P1=0XFF;
P2=0XFF;
Delay(10);
P1=0X00;
P2=0X00;
Delay(10);
P1=0XFF;
P2=0XFF;
Delay(10);
P1=0X00;
P2=0X00;
Delay(10);
P1=0XFF;
P2=0XFF;
Delay(10);

/****************貪吃蛇******************/
P0=0XF7;
P1=0XE;
P2=0X80;
Delay(50);
P1=0X7;
P2=0X80;
Delay(50);
P1=0X13;
P2=0X80;
Delay(50);
P1=0X11;
P2=0X81;
Delay(50);
P1=0X10;
P2=0X91;
Delay(50);
P1=0X00;
P2=0XB1;
Delay(50);
P1=0X00;
P2=0XF0;
Delay(50);
}

回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 精品一级电影 | 大象一区 | 色偷偷888欧美精品久久久 | 欧美一区精品 | 电影在线 | 久久久精品影院 | 欧美激情 一区 | 亚洲精品在线播放 | 欧美一级免费 | 国产成人网 | 日本a v在线播放 | 在线激情视频 | 亚洲成人精 | 亚洲午夜精品在线观看 | 一区二区三区在线播放 | 九九热精品在线 | 91视频一区二区 | 欧美激情a∨在线视频播放 成人免费共享视频 | 在线观看视频一区 | 国产欧美日韩综合精品一区二区 | 一区二区三区av | 欧美激情五月 | 久产久精国产品 | 美女亚洲一区 | 操操日| 亚洲精品一区二区三区蜜桃久 | 99久久视频 | 在线视频中文字幕 | 精品视频免费 | 福利在线观看 | 古典武侠第一页久久777 | 九九热免费在线观看 | 欧美黄a | 国产精品久久久久久一区二区三区 | 欧美精品在线播放 | 国产精品久久久久不卡 | 免费成人高清在线视频 | 亚洲精品68久久久一区 | 亚洲小视频在线播放 | 精品一区二区三区91 | 97精品超碰一区二区三区 |