Bạn đổi (AN5) thành (AN0_AN1_AN4_AN5_VREF_VREF)
|
Trích:
|
hóng tác giả phần hai mà lâu quá :(
|
em mới tìm hiểu về pic.thấy bài viết của bác TXT hay wa.thanks
hôm qua em làm thử bài nháy led code e lập theo wizad như sau: #include "D:\PIC\tuhoc\New folder\led2.h" #include<16f877a.h> #include<def_877a.h> #FUSES NOWDT,HS,NOPUT,NOPROTECT,NODEBUG,NOBROWNOUT,NOLVP, NOCPD,NOWRT #use delay(clock=20000000) void main() { setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); setup_psp(PSP_DISABLED); setup_spi(FALSE); setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); setup_timer_1(T1_DISABLED); setup_timer_2(T2_DISABLED,0,1); setup_comparator(NC_NC_NC_NC); setup_vref(FALSE); TRISB=0x00; PORTB=0xFF; // TODO: USER CODE!! While(1) { PORTB=0x00; delay_ms(250); PORTB=0xFF; delay_ms(250); } } nhưng khi dịch lại bị lỗi: |
em mới tìm hiểu về pic.thấy bài viết của bác TXT hay wa.thanks
hôm qua em làm thử bài nháy led code e lập theo wizad như sau: #include "D:\PIC\tuhoc\New folder\led2.h" #include<16f877a.h> #include<def_877a.h> #FUSES NOWDT,HS,NOPUT,NOPROTECT,NODEBUG,NOBROWNOUT,NOLVP, NOCPD,NOWRT #use delay(clock=20000000) void main() { setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); setup_psp(PSP_DISABLED); setup_spi(FALSE); setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); setup_timer_1(T1_DISABLED); setup_timer_2(T2_DISABLED,0,1); setup_comparator(NC_NC_NC_NC); setup_vref(FALSE); TRISB=0x00; PORTB=0xFF; // TODO: USER CODE!! While(1) { PORTB=0x00; delay_ms(250); PORTB=0xFF; delay_ms(250); } } nhưng khi dịch lại bị lỗi: mong các bác có kinh nghiệm xem và chỉ cho e với. thanks các bác nhiều |
jup t voi
dung xung ngoai đem san pham tu 1-9999 voi led 7 thanh lap trinh pic |
Hay...anh em cần chia sẻ như thế này rất hay.
|
em mới tìm hiểu về pic.thấy bài viết của bác TXT hay wa.thanks
hôm qua em làm thử bài nháy led code e lập theo wizad như sau: #include "D:\PIC\tuhoc\New folder\led2.h" #include<16f877a.h> #include<def_877a.h> #FUSES NOWDT,HS,NOPUT,NOPROTECT,NODEBUG,NOBROWNOUT,NOLVP, NOCPD,NOWRT #use delay(clock=20000000) void main() { setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); setup_psp(PSP_DISABLED); setup_spi(FALSE); setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); setup_timer_1(T1_DISABLED); setup_timer_2(T2_DISABLED,0,1); setup_comparator(NC_NC_NC_NC); setup_vref(FALSE); TRISB=0x00; PORTB=0xFF; // TODO: USER CODE!! While(1) { PORTB=0x00; delay_ms(250); PORTB=0xFF; delay_ms(250); } } có phải bạn chưa định nghia portB nên nó báo lỗi. Bạn thử chèn ở đầu chương trình #byte portb=0xf81 xem sao. |
Trích:
|
Các bác ơi sao trong tài liệu không thấy có chương 5 Timer vậy!
|
Chào mọi người
Mình đang ở TP.HCM. mình đang tìm mua MCP23017 (Expander 16B - I2C) nhưng không biết mua ở đâu? Bạn nào biết, chỉ mình với. Cảm ơn nhiều! |
Trích:
|
Múi giờ GMT. Hiện tại là 03:44 AM. |
Tên diễn đàn: vBulletin Version 3.8.11
Được sáng lập bởi Đoàn Hiệp.
Copyright © PIC Vietnam