Mọi người ơi.. Mình làm đồ án VĐK..Mạch và chương trình như ở dưới
Nhưng sao khi điều khiển LM35 thì LCD chỉ hiển thị những số chẵn mà k hiển thị các số lẻ vậy... Mai bảo vệ rồi.. Ai đọc được topic này mà biết được thì giúp mình với nha
Tks cả nhà nhiều
3.1. Thiết kế mạch
http://upanh.com/view/?s=upload&id=3rnd8z3q3tg
3.2. Chương trình điều khiển
#define <16f877a.h>
#include "16F877A.h"
#device *=16 adc=8
//#device PIC16F877A *=16
#use delay(clock=40000000)
#FUSES NOWDT, HS, NOPUT, NOPROTECT, NODEBUG, NOBROWNOUT, NOLVP, NOCPD, NOWRT
//#use rs232(baud=115200,parity=N,xmit=PIN_C6,rcv=PIN_C7, bits=9)
#include <LCD.C>
#INT_EXT
int8 read;
void main(void)
{
// set_tris_b(0);
set_tris_a(0xFF);
set_tris_d(0x00);
// khoi tao ngat ngoai
enable_interrupts(INT_EXT);
ext_int_edge(H_TO_L);
enable_interrupts(GLOBAL);
//Khoi tao ADC
setup_adc_ports(AN0);
setup_adc(ADC_CLOCK_INTERNAL);
delay_ms(50);
while(TRUE)
{
lcd_init();
read=read_adc();
read =read*1.9607843141;
printf(lcd_putc,"\rNhiet do : %u" ,read);
delay_us(20);
lcd_gotoxy( 2,2 );
lcd_putc ("DA VDK: Nhom 5 ");
} }