View Single Post
Old 27-05-2008, 01:15 PM   #63
Son Hien
Nhập môn đệ tử
 
Tham gia ngày: Apr 2008
Bài gửi: 3
:
Post Do nhiet do hien thi LCD dung DS1820 pic6F877A

có bài viet nay em không hiểu và sau khi viết xong em dịch nó không ra file hex co anh nào biết nhờ chỉ giúp em cảm ơn nhiều
unsigned temp;
unsigned short j;

void Display_Temperature(unsigned int temp) {
//...
}
Void main() {
ADCON1 = 0xFF;
PORTA = 0xFF;
TRISA = 0xFF;
PORB = 0;
TRISB = 0;
do {
ow_Reset(&PORTA,5);
ow_write(&PORTA,5,0xCC);
ow_write(&PORTA,5,0x44);
Delay_us(120);

ow_Reset(&PORTA,5);
ow_write(&PORTA,5,0xCC);
ow_write(&PORTA,5,0xBE);
Delay_us(400);

j = ow_Read(&PORTA,5);
temp = ow_Read(&PORTA,5);
temp <<= 8;
temp +=j;
Display_Temperature(temp);
Delay_ms(500);
}
while (1);
}//~!
Son Hien vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn