本帖最后由 eehome 于 2013-1-5 10:04 编辑
请教一下,为什么我的程序汇编成功,但不能再LCD液晶上显示出来,哪里错了?还有,自动生成的cof文件里面没有我编写的程序,只有系统自动生成的语言,是怎么回事啊?
#include
#include
#include
#include <1wire.h>
#include
// Declare your global variables here
unsigned char str[]="DS18B20 Temperature:";
void Display_temperature(unsigned int Temp)
{
unsigned char ten;
unsigned char one;
unsigned char dat;
unsigned char dat1;
unsigned int Temp;
lcd_gotoxy(0,0);
lcd_puts(str);
lcd_gotoxy(5,1); //第二行第六列
ten=Temp/1000+0x30;
one=Temp%1000/100+0x30;
dat=Temp%100/10+0x30;
dat1=Temp%10+0x30;
lcd_putchar(ten);
lcd_putchar(one);
lcd_putchar(".");
lcd_putchar(dat);
lcd_putchar(dat1);
}
void main(void)
{
// Declare your local variables here
w1_init();
lcd_init(16);
lcd_clear();
while (1)
{
Temp=Read_temperature(0x00);
Display_temperature(Temp);
delay_ms(500);
}
}