23-02-2012, 12:11 AM | #36 |
Nhập môn đệ tử
Tham gia ngày: Feb 2012
Bài gửi: 1
: |
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. |
|
|
Similar Threads | ||||
Ðề tài | Người gửi | Chuyên mục | Trả lời | Bài mới |
Hướng dẫn ORCAD cơ bản (Update 16/11/2005) | falleaf | Thực hành | 167 | 23-10-2013 04:30 PM |