View Single Post
Old 27-09-2008, 08:38 PM   #5
anh_gioi
Đệ tử 6 túi
 
Tham gia ngày: Oct 2006
Bài gửi: 147
:
Trích:

#include "F:\NCKH 2009\PIC 16\count_timer2\count_timer2.h"
#include <lcd_lib_4bit.c>
#include <F:\NCKH 2009\PIC 16\count_timer2\def_877a.h>
int16 value;
#INT_TIMER0

void main()
{
setup_ccp1(CCP_CAPTURE_RE);
//setup_ccp1(CCP_CAPTURE_DIV_16);

enable_interrupts(INT_CCP1); // Setup interrupt on falling edge
enable_interrupts(GLOBAL);

trisd = 0x00;
trisc = 0x04;

LCD_init();
Printf(LCD_putchar,"gioi");

setup_timer_1(T1_INTERNAL | T1_DIV_BY_4);

while(!input(pin_c2)) {} // Wait for senser output to go high;
set_timer1(0);
while(input(pin_c2)) {}
value = get_timer1();

LCD_putcmd(0xC0);
LCD_putchar(value);
//printf(LCD_putchar, value );
LCD_putcmd(0xCb);
printf(LCD_putchar," giay");

}
em đã khởi tạo capture rùi, nhưng vẫn chưa ổn cho lắm?????---> vẫn vậy.
help me!
anh_gioi vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn