谁帮忙看一下这个程序是否能够实现?
主函数/***************************************************************/
#include<reg52.h>
#include "control.h"
#include "12864.h"
#include "ADXL.H"
#define uchar unsigned char
#define uint unsigned int
sbit key=P2^7;
void timer_init()
{
TMOD=0X10;
TH1=(65535-100)/256;
TL1=(65535-100)%256;
EA=1;
ET1=1;
TR1=1;
}
void main()
{
char devid;
timer_init();
lcd_12864_init();
Init_ADXL345(); //初始化ADXL345
devid=Single_Read_ADXL345(0X00); //读出的数据为0XE5,表示正确
while(1)
{
adxl345();
if(key==0)
keyscan_1();
else
keyscan();
}
}
/***************************************************************/
Controh.H文件
#ifndef __contral_h_
#define __contral_h_
extern signed char pwm;
extern void delayms(unsigned int xms);
extern void keyscan();
extern void keyscan_1();
#endif
/***************************************************************/
Control.C文件
#include<reg51.h>
#include "control.h"
#include "12864.h"
#define uchar unsigned char
#define uint unsigned int
#define keydata P0
sbit A1=P2^4;
sbit A2=P2^5;
sbit ENA=P2^6;
signed int count=0;
signed char pwm=0;
signed char anjian=0;
uchar numshi=0;
uchar numge=0;
void delayms(unsigned int xms)
{
unsigned int i,j;
for(i=0;i<xms;i++)
for(j=0;j<110;j++);
}
void pwm_dis()
{
numshi=pwm/10;
numge=pwm%10;
write_12864_data(0x30+numshi);
write_12864_data(0x30+numge);
}
void anjian_dis()
{
numshi=anjian/10;
numge=anjian%10;
write_12864_data(0x30+numshi);
write_12864_data(0x30+numge);
}
void keyscan()
{
unsigned char dat=0;
unsigned char num=0;
keydata=0xfe;
dat=keydata;
dat=dat&0xf0;
while(dat!=0xf0)
{
delayms(5);
dat=keydata;
dat=dat&0xf0;
while(dat!=0xf0)
{
dat=keydata;
switch(dat)
{
case 0xee:num=1;
break;
case 0xde:num=2;
break;
case 0xbe:num=3;
break;
case 0x7e:num=4;
break;
}
while(dat!=0xf0)
{
dat=keydata;
dat=dat&0xf0;
}
}
}
keydata=0xfd;
dat=keydata;
dat=dat&0xf0;
while(dat!=0xf0)
{
delayms(5);
dat=keydata;
dat=dat&0xf0;
while(dat!=0xf0)
{
dat=keydata;
switch(dat)
{
case 0xed:num=5;
break;
case 0xdd:num=6;
break;
case 0xbd:num=7;
break;
case 0x7d:num=8;
break;
}
while(dat!=0xf0)
{
dat=keydata;
dat=dat&0xf0;
}
}
}
keydata=0xfb;
dat=keydata;
dat=dat&0xf0;
while(dat!=0xf0)
{
delayms(5);
dat=keydata;
dat=dat&0xf0;
while(dat!=0xf0)
{
dat=keydata;
switch(dat)
{
case 0xeb:num=9;
break;
case 0xdb:num=10;
break;
case 0xbb:num=11;
break;
case 0x7b:num=12;
break;
}
while(dat!=0xf0)
{
dat=keydata;
dat=dat&0xf0;
}
}
}
keydata=0xf7;
dat=keydata;
dat=dat&0xf0;
while(dat!=0xf0)
{
delayms(5);
dat=keydata;
dat=dat&0xf0;
while(dat!=0xf0)
{
dat=keydata;
switch(dat)
{
case 0xe7:num=13;
break;
case 0xd7:num=14;
break;
case 0xb7:num=15;
break;
case 0x77:num=16;
break;
}
while(dat!=0xf0)
{
dat=keydata;
dat=dat&0xf0;
}
}
}
switch(num)
{
case 1: write_12864_addr(1,3);
pwm=0;
pwm_dis();
break;
case 2: write_12864_addr(1,3);
pwm=10;
pwm_dis();
break;
case 3:write_12864_addr(1,3);
pwm=20;
pwm_dis();
break;
case 4:write_12864_addr(1,3);
pwm=30;
pwm_dis();
break;
case 5:write_12864_addr(1,3);
pwm=40;
pwm_dis();
break;
case 6:write_12864_addr(1,3);
pwm=50;
pwm_dis();
break;
case 7:write_12864_addr(1,3);
pwm=60;
pwm_dis();
break;
case 8:write_12864_addr(1,3);
pwm=70;
pwm_dis();
break;
case 9: write_12864_addr(1,3);
pwm=80;
pwm_dis();
break;
case 10: write_12864_addr(1,3);
pwm=90;
pwm_dis();
break;
case 11:write_12864_addr(1,3);
pwm=99;
pwm_dis();
break;
case 12:write_12864_addr(1,3);
pwm=35;
pwm_dis();
break;
case 13:write_12864_addr(1,3);
pwm=pwm+5;
pwm_dis();
break;
case 14:write_12864_addr(1,3);
pwm=pwm-5;
pwm_dis();
break;
case 15:write_12864_addr(1,3);
pwm=pwm+1;
pwm_dis();
break;
case 16:write_12864_addr(1,3);
pwm=pwm-1;
pwm_dis();
break;
}
}
void keyscan_1()
{
unsigned char dat=0;
unsigned char num=0;
keydata=0xfe;
dat=keydata;
dat=dat&0xf0;
while(dat!=0xf0)
{
delayms(5);
dat=keydata;
dat=dat&0xf0;
while(dat!=0xf0)
{
dat=keydata;
switch(dat)
{
case 0xee:num=1;
break;
case 0xde:num=2;
break;
case 0xbe:num=3;
break;
case 0x7e:num=4;
break;
}
while(dat!=0xf0)
{
dat=keydata;
dat=dat&0xf0;
}
}
}
keydata=0xfd;
dat=keydata;
dat=dat&0xf0;
while(dat!=0xf0)
{
delayms(5);
dat=keydata;
dat=dat&0xf0;
while(dat!=0xf0)
{
dat=keydata;
switch(dat)
{
case 0xed:num=5;
break;
case 0xdd:num=6;
break;
case 0xbd:num=7;
break;
case 0x7d:num=8;
break;
}
while(dat!=0xf0)
{
dat=keydata;
dat=dat&0xf0;
}
}
}
keydata=0xfb;
dat=keydata;
dat=dat&0xf0;
while(dat!=0xf0)
{
delayms(5);
dat=keydata;
dat=dat&0xf0;
while(dat!=0xf0)
{
dat=keydata;
switch(dat)
{
case 0xeb:num=9;
break;
case 0xdb:num=10;
break;
case 0xbb:num=11;
break;
case 0x7b:num=12;
break;
}
while(dat!=0xf0)
{
dat=keydata;
dat=dat&0xf0;
}
}
}
keydata=0xf7;
dat=keydata;
dat=dat&0xf0;
while(dat!=0xf0)
{
delayms(5);
dat=keydata;
dat=dat&0xf0;
while(dat!=0xf0)
{
dat=keydata;
switch(dat)
{
case 0xe7:num=13;
break;
case 0xd7:num=14;
break;
case 0xb7:num=15;
break;
case 0x77:num=16;
break;
}
while(dat!=0xf0)
{
dat=keydata;
dat=dat&0xf0;
}
}
}
switch(num)
{
case 1: write_12864_addr(3,7);
anjian=0;
anjian_dis();
break;
case 2: write_12864_addr(3,7);
anjian=10;
anjian_dis();
break;
case 3:write_12864_addr(3,7);
anjian=20;
anjian_dis();
break;
case 4:write_12864_addr(3,7);
anjian=30;
anjian_dis();
break;
case 5:write_12864_addr(3,7);
anjian=40;
anjian_dis();
break;
case 6:write_12864_addr(3,7);
anjian=50;
anjian_dis();
break;
case 7:write_12864_addr(3,7);
anjian=60;
anjian_dis();
break;
case 8:write_12864_addr(3,7);
anjian=anjian+1;
anjian_dis();
break;
case 9: write_12864_addr(3,7);
anjian=anjian+2;
anjian_dis();
break;
case 10: write_12864_addr(3,7);
anjian=anjian+3;
anjian_dis();
break;
case 11:write_12864_addr(3,7);
anjian=anjian+4;
anjian_dis();
break;
case 12:write_12864_addr(3,7);
anjian=anjian+5;
anjian_dis();
break;
case 13:write_12864_addr(3,7);
anjian=anjian+6;
anjian_dis();
break;
case 14:write_12864_addr(3,7);
anjian=anjian+7;
anjian_dis();
break;
case 15:write_12864_addr(3,7);
anjian=anjian+8;
anjian_dis();
break;
case 16:write_12864_addr(3,7);
anjian=anjian+9;
anjian_dis();
break;
}
}
void timer0() interrupt 3
{
A1=1;
A2=0;
TH1=(65535-100)/256;
TL1=(65535-100)%256;
count++;
if(count>=100)
count=0;
if(count<pwm)
{
ENA=1;
}
else
ENA=0;
}
/***************************************************************/
12864.H文件
#ifndef __12864_h_
#define __12864_h_
//extern void lcd_writestring(unsigned char *str); //向lcd发送一个字符串,长度64字符之内。
extern void write_12864_cmd(unsigned char cmd ); //向液晶写数据
extern void write_12864_data(unsigned char dat); //向液晶写数据
extern void lcd_12864_init(); //初始化液晶
extern void write_12864_addr(unsigned char x ,unsigned char y); //写液晶的地址
extern void delayms_12864(unsigned char xms); //延时函数
//extern void write_12864_addr(unsigned char x ,unsigned char y); //写液晶的地址
#endif
/************************************************************/
12864.C文件
/**************************************************************
12864指令: 0x01 //将DDRAM填满“20H”,并且设定DDRAM的地址计数器(AC)到“00H”
0x02 //设定DDRAM的地址计数器 (AC)到“00H”,
并且将游标移到开头原点位置;这个指令并不改变DDRAM的内容
0x04 //读写后,AC减一,向左写
0x06 //读写后,AC加一,向右写
0x10 //光标向左移动,AC减一
0x14 //光标向右移动,AC加一
0x18 //显示向左移动,光标跟着移动
0x1c //显示向右移动,光标跟着移动
0x0c //整体显示开,游标关,游标位置反白不允许
0x0e //整体显示开,游标开,游标位置反白不允许
0x0f //整体显示开,游标开,游标位置反白允许
0x08 //关显示,关光标,关光标闪烁
0x30 //8位数据端口,基本指令操作
0x34 //8位数据总线,扩展指令集
0x20 //4位数据总线,基本指令集
0x24 //4位数据总线,扩展指令集
**************************************************************/
#include<reg52.h>
#include "12864.h"
#include "control.h"
#define lcd_data P1 //定义液晶数据端口
sbit lcd_PSB=P3^7; //液晶串行数据和并行数据选择端
sbit lcd_EN=P3^4; //液晶en使能端
sbit lcd_RS=P3^5; //液晶的rs
sbit lcd_RW=P3^6; //液晶的rw读写端口
void delayms_12864(unsigned char xms) //延时函数
{
unsigned char i,j;
for(i=0;i<xms;i++)
for(j=0;j<110;j++);
}
bitcheck_12864_busy() //检测液晶忙不忙
{
bit result=0;
lcd_RS=0;
lcd_RW=1;
lcd_EN=1;
delayms_12864(3);
result=(bit)(lcd_data&0x80);//取出数据端口的最高位
lcd_EN=0;
return result;
}
void write_12864_cmd(unsigned char cmd ) //写指令
{
while(check_12864_busy()); //检测液晶忙不忙
lcd_RS=0; //rs=0为写命令
lcd_EN=0;
lcd_RW=0;
lcd_data=cmd; //把指令给数据端口
delayms_12864(1);
lcd_EN=1;
delayms_12864(1);
lcd_EN=0;
}
void write_12864_data(unsigned char dat) //向液晶写数据
{
while(check_12864_busy()); //检测液晶忙不忙
lcd_RS=1; //rs=1为写数据
lcd_EN=0;
lcd_RW=0;
lcd_data=dat; //把数据给数据端口
delayms_12864(1);
lcd_EN=1;
delayms_12864(1);
lcd_EN=0;
}
void lcd_12864_init() //初始化液晶
{
lcd_PSB=1;
write_12864_cmd(0x30);
delayms_12864(5);
write_12864_cmd(0x0c);
delayms_12864(5);
write_12864_cmd(0x01);
delayms_12864(5);
}
void write_12864_addr(unsigned char x ,unsigned char y) //写液晶的地址
{
unsigned char addr;
if(x==0) //如果x=0,地址为液晶第一行
{x=0x80;}
else if(x==1) //如果x=1,地址为液晶第二行
{x=0x90;}
else if(x==2) //如果x=2,地址为液晶第三行
{x=0x88;}
else if(x==3) //如果x=3,地址为液晶第四行
{x=0x98;}
addr=x+y;
write_12864_cmd(addr);
}
/******************************************************************/
ADXL.H文件
#ifndef __ADXL_h_
#define __ADXL_h_
//extern void jiaodu(); //角度转换
//extern void display_x(); //x轴
//extern void display_y(); //y轴
//extern void display_z();//z轴
extern void Init_ADXL345(); //延时函数
extern unsigned char Single_Read_ADXL345(unsigned char REG_Address);
//extern void Multiple_read_ADXL345(void);
extern void adxl345();
#endif
/****************************************************************/
ADXL.C 文件
#include<REG51.H>
#include<math.h> //Keil library
#include<stdio.h> //Keil library
#include<INTRINS.H>
#include"12864.h"
#define uchar unsigned char
#define uint unsigned int
#define DataPort P1 //LCD1602数据端口
sbit SCL=P2^0; //IIC时钟引脚定义
sbit SDA=P2^1; //IIC数据引脚定义
sbit LED=P2^2;
#define SlaveAddress 0xA6 //定义器件在IIC总线中的从地址,根据ALTADDRESS地址引脚不同修改
//ALTADDRESS引脚接地时地址为0xA6,接电源时地址为0x3A
typedef unsigned charBYTE;
typedef unsigned short WORD;
BYTE BUF; //接收数据缓存区
uchar ge,shi,bai,qian,wan; //显示变量
intdis_data;
//变量
void delay(unsigned int k);
void InitLcd(); //初始化lcd1602
void Init_ADXL345(void); //初始化ADXL345
void WriteDataLCM(uchar dataW);
void WriteCommandLCM(uchar CMD,uchar Attribc);
//void DisplayOneChar(uchar X,uchar Y,uchar DData);
void conversion(uint temp_data);
voidSingle_Write_ADXL345(uchar REG_Address,uchar REG_data); //单个写入数据
uchar Single_Read_ADXL345(uchar REG_Address); //单个读取内部寄存器数据
voidMultiple_Read_ADXL345(); //连续的读取内部寄存器数据
//------------------------------------
void Delay5us();
void Delay5ms();
void ADXL345_Start();
void ADXL345_Stop();
void ADXL345_SendACK(bit ack);
bitADXL345_RecvACK();
void ADXL345_SendByte(BYTE dat);
BYTE ADXL345_RecvByte();
void ADXL345_ReadPage();
void ADXL345_WritePage();
float tempz;
float tempy;
float tempx;
uchar tab[]="度";
uchar tab1[]="偏转";
uchar tab2[]="风力";
uchar tab3[]="输入";
//-----------------------------------
//*********************************************************
void conversion(uint temp_data)
{
wan=temp_data/10000+0x30 ;
temp_data=temp_data%10000; //取余运算
qian=temp_data/1000+0x30 ;
temp_data=temp_data%1000; //取余运算
bai=temp_data/100+0x30 ;
temp_data=temp_data%100; //取余运算
shi=temp_data/10+0x30 ;
temp_data=temp_data%10; //取余运算
ge=temp_data+0x30;
}
/***********************************/
/*void DisplayOneChar(uchar DData)
{
//Y&=1;
//X&=15;
//if(Y)X|=0x40;
//X|=0x80;
//write_12864_addr(X,0);
write_12864_data(DData);
}*/
/**************************************
延时5微秒(STC90C52RC@12M)
不同的工作环境,需要调整此函数,注意时钟过快时需要修改
当改用1T的MCU时,请调整此延时函数
**************************************/
void Delay5us()
{
_nop_();_nop_();_nop_();_nop_();
_nop_();_nop_();_nop_();_nop_();
_nop_();_nop_();_nop_();_nop_();
}
/**************************************
延时5毫秒(STC90C52RC@12M)
不同的工作环境,需要调整此函数
当改用1T的MCU时,请调整此延时函数
**************************************/
void Delay5ms()
{
WORD n = 560;
while (n--);
}
/**************************************
起始信号
**************************************/
void ADXL345_Start()
{
SDA = 1; //拉高数据线
SCL = 1; //拉高时钟线
Delay5us(); //延时
SDA = 0; //产生下降沿
Delay5us(); //延时
SCL = 0; //拉低时钟线
}
/**************************************
停止信号
**************************************/
void ADXL345_Stop()
{
SDA = 0; //拉低数据线
SCL = 1; //拉高时钟线
Delay5us(); //延时
SDA = 1; //产生上升沿
Delay5us(); //延时
}
/**************************************
发送应答信号
入口参数:ack (0:ACK 1:NAK)
**************************************/
void ADXL345_SendACK(bit ack)
{
SDA = ack; //写应答信号
SCL = 1; //拉高时钟线
Delay5us(); //延时
SCL = 0; //拉低时钟线
Delay5us(); //延时
}
/**************************************
接收应答信号
**************************************/
bit ADXL345_RecvACK()
{
SCL = 1; //拉高时钟线
Delay5us(); //延时
CY = SDA; //读应答信号
SCL = 0; //拉低时钟线
Delay5us(); //延时
return CY;
}
/**************************************
向IIC总线发送一个字节数据
**************************************/
void ADXL345_SendByte(BYTE dat)
{
BYTE i;
for (i=0; i<8; i++) //8位计数器
{
dat <<= 1; //移出数据的最高位
SDA = CY; //送数据口
SCL = 1; //拉高时钟线
Delay5us(); //延时
SCL = 0; //拉低时钟线
Delay5us(); //延时
}
ADXL345_RecvACK();
}
/**************************************
从IIC总线接收一个字节数据
**************************************/
BYTE ADXL345_RecvByte()
{
BYTE i;
BYTE dat = 0;
SDA = 1; //使能内部上拉,准备读取数据,
for (i=0; i<8; i++) //8位计数器
{
dat <<= 1;
SCL = 1; //拉高时钟线
Delay5us(); //延时
dat |= SDA; //读数据
SCL = 0; //拉低时钟线
Delay5us(); //延时
}
return dat;
}
//******单字节写入*******************************************
void Single_Write_ADXL345(uchar REG_Address,uchar REG_data)
{
ADXL345_Start(); //起始信号
ADXL345_SendByte(SlaveAddress); //发送设备地址+写信号
ADXL345_SendByte(REG_Address); //内部寄存器地址,请参考中文pdf22页
ADXL345_SendByte(REG_data); //内部寄存器数据,请参考中文pdf22页
ADXL345_Stop(); //发送停止信号
}
//********单字节读取*****************************************
uchar Single_Read_ADXL345(uchar REG_Address)
{uchar REG_data;
ADXL345_Start(); //起始信号
ADXL345_SendByte(SlaveAddress); //发送设备地址+写信号
ADXL345_SendByte(REG_Address); //发送存储单元地址,从0开始
ADXL345_Start(); //起始信号
ADXL345_SendByte(SlaveAddress+1); //发送设备地址+读信号
REG_data=ADXL345_RecvByte(); //读出寄存器数据
ADXL345_SendACK(1);
ADXL345_Stop(); //停止信号
return REG_data;
}
//*********************************************************
//
//连续读出ADXL345内部加速度数据,地址范围0x32~0x37
//
//*********************************************************
void Multiple_read_ADXL345(void)
{ uchar i;
ADXL345_Start(); //起始信号
ADXL345_SendByte(SlaveAddress); //发送设备地址+写信号
ADXL345_SendByte(0x32); //发送存储单元地址,从0x32开始
ADXL345_Start(); //起始信号
ADXL345_SendByte(SlaveAddress+1); //发送设备地址+读信号
for (i=0; i<6; i++) //连续读取6个地址数据,存储中BUF
{
BUF = ADXL345_RecvByte(); //BUF存储0x32地址中的数据
if (i == 5)
{
ADXL345_SendACK(1); //最后一个数据需要回NOACK
}
else
{
ADXL345_SendACK(0); //回应ACK
}
}
ADXL345_Stop(); //停止信号
Delay5ms();
}
//*****************************************************************
//初始化ADXL345,根据需要请参考pdf进行修改************************
void Init_ADXL345()
{
Single_Write_ADXL345(0x31,0x0B); //测量范围,正负16g,13位模式
Single_Write_ADXL345(0x2C,0x08); //速率设定为12.5 参考pdf13页
Single_Write_ADXL345(0x2D,0x08); //选择电源模式 参考pdf24页
Single_Write_ADXL345(0x2E,0x80); //使能 DATA_READY 中断
Single_Write_ADXL345(0x1E,0x00); //X 偏移量 根据测试传感器的状态写入pdf29页
Single_Write_ADXL345(0x1F,0x00); //Y 偏移量 根据测试传感器的状态写入pdf29页
Single_Write_ADXL345(0x20,0x05); //Z 偏移量 根据测试传感器的状态写入pdf29页
}
//***********************************************************************
//显示x轴
void display_x()
{ //float tempx;
dis_data=(BUF<<8)+BUF;//合成数据
if(dis_data<0)
{
dis_data=-dis_data;
write_12864_addr(2,1);
write_12864_data('-'); //显示正负符号位
}
else
{
write_12864_addr(2,1);
write_12864_data(' '); //显示空格
}
tempx=(float)dis_data*3.9;//计算数据和显示,查考ADXL345快速入门第4页
conversion(tempx); //转换出显示需要的数据
write_12864_addr(2,0);
write_12864_data('X');
write_12864_data(':');
write_12864_addr(2,2);
write_12864_data(qian);
write_12864_data('.');
write_12864_addr(2,3);
write_12864_data(bai);
write_12864_data(shi);
//write_12864_addr(2,3);
//DisplayOneChar(' ');
}
//***********************************************************************
//显示y轴
void display_y()
{ //float tempy;
dis_data=(BUF<<8)+BUF;//合成数据
if(dis_data<0)
{
dis_data=-dis_data;
write_12864_addr(2,5);
write_12864_data('-'); //显示正负符号位
}
else
{
write_12864_addr(2,5);
write_12864_data(' '); //显示空格
}
tempy=(float)dis_data*3.9;//计算数据和显示,查考ADXL345快速入门第4页
conversion(tempy);//转换出显示需要的数据
write_12864_addr(2,4);
write_12864_data('Y'); //第1行,第0列 显示y
write_12864_data(':');
write_12864_addr(2,6);
write_12864_data(qian);
write_12864_data('.');
write_12864_addr(2,7);
write_12864_data(bai);
write_12864_data(shi);
// write_12864_addr(2,7);
// DisplayOneChar(' ');
}
//***********************************************************************
//显示z轴
void display_z()
{
//float temp;
dis_data=(BUF<<8)+BUF; //合成数据
if(dis_data<0)
{
dis_data=-dis_data;
write_12864_addr(3,1);
write_12864_data('-'); //显示负符号位
}
else
{
write_12864_addr(3,1);
write_12864_data(' ');//显示空格
}
tempz=(float)dis_data*3.9;//计算数据和显示,查考ADXL345快速入门第4页
conversion(tempz); //转换出显示需要的数据
write_12864_addr(3,0);
write_12864_data('Z');//第0行,第10列 显示Z
write_12864_data(':');
write_12864_addr(3,2);
write_12864_data(qian);
write_12864_data('.');
write_12864_addr(3,3);
write_12864_data(bai);
write_12864_data(shi);
//write_12864_addr(3,4);
//DisplayOneChar(' ');
}
/*void adxl()
{
uchar devid;
uchar i,j;
float w;
delay(500);
Init_ADXL345(); //初始化ADXL345
devid=Single_Read_ADXL345(0X00);
} */
void jiaodu()
{
uchar i,j,k;
float w;
w=(180*atan(tempz/tempx))/3.14;
if(w>=41&&w<=49)
{
LED=0;
}
else
LED=1;
conversion(w);
write_12864_addr(1,4);
{
for(j=0;tab1!='\0';j++)
write_12864_data(tab1);
}
write_12864_addr(1,6);
write_12864_data(shi);
write_12864_data(ge);
write_12864_addr(1,7);
{
for(i=0;tab!='\0';i++)
write_12864_data(tab);
}
write_12864_addr(3,4);
{
for(k=0;tab2!='\0';k++)
write_12864_data(tab2);
}
write_12864_addr(1,0);
{
for(k=0;tab3!='\0';k++)
write_12864_data(tab3);
}
}
void adxl345()
{
Multiple_Read_ADXL345(); //连续读出数据,存储在BUF中
display_x(); //---------显示X轴
display_y(); //---------显示Y轴
display_z(); //---------显示Z轴
//delay(200);
jiaodu();
}
看的头晕。。。 {:shocked:} 你那我们当成什么?你的员工?帮你检查作业? 功能说明、电路、……什么都没有 {:lol:} 下班后,头昏,最多可以提供思路,算法。谁有精力给你看程序!{:sleepy:}{:sleepy:}{:sleepy:} {:sweat:}表示不知道想要表达什么 {:dizzy:}看得头有点晕 楼主把程序压缩后上传,将问题提出来,大家才可以看,我相信这样大家看见都会头晕的. {:dizzy:}擦,不带这么使唤人的啊
页:
[1]