某個光立方的程序里面
#include<reg51.h> //包含頭文件,一般情況不需要改動,頭文件包含特殊功能寄存器的定義
#define DataPort P0 //定義數(shù)據(jù)端口 程序中遇到DataPort 則用P0 替換
sbit line_LATCH=P1^0;//定義鎖存使能端口 行掃描的鎖存端口
sbit LATCH1=P2^0;//定義鎖存使能端口 第一燈板的字節(jié)鎖存
sbit LATCH2=P2^1;//
sbit LATCH3=P2^2;//
sbit LATCH4=P2^3;
sbit LATCH5=P2^4;
sbit LATCH6=P2^5;
sbit LATCH7=P2^6;
sbit LATCH8=P2^7;
里面P1.0是定義什么?后面是八個是74hc的io口定義我懂
然后是不是就可以粘貼3d取模軟件里面的數(shù)組了?
想知道3d取模軟件的用法,不是很懂
后面我自己寫的 不知道哪里有問題 也不知道該怎么寫下去了
#include "STC12C5A.H"
#include "huxi.c"
//定義IO口
sbit LA0=P0^0;
sbit LA1=P0^1;
sbit LA2=P0^2;
sbit LA3=P0^3;
sbit LA4=P0^4;
sbit LA5=P0^5;
sbit LA6=P0^6;
sbit LA7=P0^7; //8個74hc的腳
sbit key0=P4^7;
sbit key1=P3^2;
sbit key2=P3^3;
//定義變量
#define uchar unsigned char
#define uint unsigned int
//按鍵
uchar num;
uchar NUM;
void main()
{
while (1)
{
if(key0==0)
{
void Delay20ms() //@22.1184MHz yanshi
{
unsigned char i, j, k;
i = 2;
j = 175;
k = 75;
do
{
do
{
while (--k);
} while (--j);
} while (--i);
} //finish
if(key==0)
{num=0;}
}
if(!key1)
{
void Delay20ms() //@22.1184MHz yanshi
{
unsigned char i, j, k;
i = 2;
j = 175;
k = 75;
do
{
do
{
while (--k);
} while (--j);
} while (--i);
} //finish
if(!key1)
{num++;}
}
if(!key2)
{
void Delay20ms() //@22.1184MHz yanshi
{
unsigned char i, j, k;
i = 2;
j = 175;
k = 75;
do
{
do
{
while (--k);
} while (--j);
} while (--i);
} //finish
if(!key2)
{NUM=num;}
}
}}
//開機檢測
unsigned char code ceng[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
unsigned char code di[1234][8]=
{}
|