某个光立方的程序里面
#include<reg51.h> //包含头文件,一般情况不需要改动,头文件包含特殊功能寄存器的定义
#define DataPort P0 //定义数据端口 程序中遇到DataPort 则用P0 替换
sbit line_LATCH=P1^0;//定义锁存使能端口 行扫描的锁存端口
sbit LATCH1=P2^0;//定义锁存使能端口 第一灯板的字节锁存
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取模软件里面的数组了?
想知道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]=
{}
|