ESP8266重启模块后为什么会一直返回数据?
这说明模块在不停的重启,需要重新刷固件.
求一Mcs51单片机关于采集A/D转换数据的C程序
89C52采集0809八位AD并显示出来的。现在估计没有人用了….
#include
#include
#define uchar unsigned char
#define uint unsigned int
#define LCDCOM XBYTE[0x8ffc] //LCD写命令寄存器地址
#define LCDDATA XBYTE[0x8ffd] //LCD写数据寄存器地址
#define LCDSTATUS XBYTE[0x8ffe] //LCD读状态寄存器地址
#define IN2 XBYTE[0x7ffa] //IN2通道地址
sbit ad_busy=P3^2;
sbit bflag=ACC^7;
//函数的声明部分
void delay1(uint x);
void lcd_busy();
void lcd_cmd(uchar lcd_cmd);
void lcd_data(uchar lcd_data);
void lcd_moveto(uchar position);
void init(void);
void ad0809(void);
uchar string[10]={“dianya is:”};
uchar temp[6]={0x00,0x0a,0x00,0x00,0x00,0x0b};
uchar code dis_buf[13]={0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x2e,0x56,0x20};//为0到9的ASCLL码
void delay1(uint x) //延时1ms程序
{
uchar j;
while(x–)
{
for(j=0;j<125;j++)
{;}
}
}
void lcd_busy() //检测lcd忙程序
{
do
{
ACC=LCDSTATUS;
}
while(bflag==1); //当他忙的时候就不停的检测,直到空闲为止
}
void lcd_cmd(uchar lcd_cmd) //写命令函数
{
LCDCOM=lcd_cmd;
lcd_busy();
}
void lcd_data(uchar lcd_data) //写数据函数
{
LCDDATA=lcd_data;
lcd_busy();
}
void lcd_moveto(uchar position) //确定显示位置
{
uchar temp; //为显示位置对应的地址
if (position<16)
temp=(position+0x80-1); //为在第一行
else
temp=((position-16)+0xc0); //为第二行
lcd_cmd(temp);
}
void init(void) //lcd初始化
{
lcd_cmd(0x30); //置功能:1行,5*7字符
lcd_busy();
lcd_cmd(0x30); //置功能:1行,5*7字符
lcd_busy();
lcd_cmd(0x30); //置功能:1行,5*7字符
lcd_busy();
lcd_cmd(0x38); //置功能:2行,5*7字符
lcd_busy();
lcd_cmd(0x06); //置输入模式:地址增量,显示屏不移动
lcd_busy();
lcd_cmd(0x0c); //置显示开,不显示光标,光标不闪烁
lcd_busy();
lcd_cmd(0x01); //清显示
lcd_busy();
}
void ad0809(void)
{
uchar i;
uint a=0;
IN2=0;
i=i;
i=i;
while(ad_busy==0);
a=IN2;
a=a*200/255;
a=a*25;
temp[0]=a/1000;
temp[2]=a%1000/100;
temp[3]=a%100/10;
temp[4]=a%10;
}
void main(void)
{
uchar i,j;
P2=0xff;
P1=0xff;
P0=0xff;
delay1(20);
init();
while(1)
{
ad0809();
lcd_moveto(1);
for(j=0;j<10;j++)
{
lcd_data(string[j]);
}
lcd_moveto(16);
for(i=0;i<6;i++)
{
lcd_data(dis_buf[temp[i]]);
}
}
}
外贸英语口语培训中心有专业的吗? ?
外贸英语口语培训这家不错,那里的老外教的挺好的,有兴趣的话可以试试. http://saying.spiiker.com/trade/
英语雅思词汇用什么方法冲刺最快速
在线背单词吧,可以加深记忆.你不妨去试试,我之前在这家spiiker英语学过,感觉他们的背单词系统挺不错的. http://amy1121.blog.163.com/blog/static/200021054201111795236840/