PIC Vietnam

Go Back   PIC Vietnam > Microchip PIC > Các ngôn ngữ lập trình khác (CCS C, HT PIC,...) > Lỗi lập trình ngôn ngữ cấp cao

Tài trợ cho PIC Vietnam
Trang chủ Đăng Kí Hỏi/Ðáp Thành Viên Lịch Tìm Kiếm Bài Trong Ngày Ðánh Dấu Ðã Ðọc Vi điều khiển

Lỗi lập trình ngôn ngữ cấp cao Những lỗi trường gặp trong lập trình. Khóa luồng khi bug được lỗi.

 
 
Ðiều Chỉnh Xếp Bài
Prev Previous Post   Next Post Next
Old 07-06-2012, 11:37 AM   #1
huyckc
Nhập môn đệ tử
 
Tham gia ngày: Aug 2011
Bài gửi: 3
:
xin mọi người giúp sửa lỗi (improper use of a function identifier)

mình đang viết chương trình cho xe chạy, mà nó báo lỗi thế này chả biết làm sao,mong mọi người chỉ giùm,mình gà lắm.
thank all

#include <16f887.h>
#FUSES nowdt,noprotect,nolvp,xt
#use delay(clock=4000000)
#use fast_io(a)
#use fast_io(b)
#use fast_io(c)
#use fast_io(d)
#use fast_io(e)
#byte porta=0x5
#byte portc=0x7
#byte portd=0x8
#byte portb=0x6
#byte porte=0x9
#byte intcon=0x000B
#bit a0=porta.0
#bit a1=porta.1
#bit a2=porta.2
#bit a3=porta.3
#bit a4=porta.4
#bit a5=porta.5
#bit d0=portd.0
#bit d1=portd.1
#bit b0=portb.0
#bit b1=portb.1
#bit b2=portb.2
#bit b3=portb.3
#bit b4=portb.4
#bit b5=portb.5
#bit b6=portb.6
#bit b7=portb.7
#bit c0=portc.0
#bit c1=portc.1
#bit c2=portc.2
#bit dxungt=portc.3
#bit dxungp=portd.0
#bit tl=portc.4
#bit ll=portc.5
#bit tr=portc.6
#bit lr=portc.7
#bit d4=portd.4
#bit d5=portd.5
#bit d6=portd.6
#bit d7=portd.7
#bit e0=porte.0
#bit e1=porte.1
#bit e2=porte.2
#bit RBIF=intcon.0
#bit RBIE=intcon.3
#include <lcd.c>
float kc;
int16 k,kt,v,d,i,dem,star;
void hienthi();
void di_thang();
void queo_trai();
void queo_phai();
void lui_20();

void queo_trai()
{ lcd_gotoxy(1,1);
lcd_putc("dang queo trai");
lcd_gotoxy(14,1);
lcd_putc("ROBOT TU HANH");
delay_ms(30);
set_tris_c(0x00);//tat srf
dxungt=0;
dxungp=1;
tr=1;
ll=tl=lr=0;
set_pwm1_duty(150);
delay_ms(1000);
while(d<9)
{kt=d;
dxungt=1;
dxungp=0;
tl=ll=tr=0;
lr=1;
set_pwm1_duty(150);
while(d==kt)
{queo_phai();
}}
while((d>=9)&(d<=11))
{
di_thang();
}}

void queo_phai()
{
lcd_gotoxy(1,1); ///improper use of a function identifier
lcd_putc("dang queo phai");
lcd_gotoxy(14,1);
lcd_putc("ROBOT TU HANH");
delay_ms(30);
set_tris_c(0x00);
dxungt=1;
dxungp=0;
lr=ll=tr=0; //re phai goc d
tl=1;
set_pwm1_duty (150);
delay_ms(1000);
while(d<9)
{kt=d;
dxungt=0;
dxungp=1;
ll=1;
tl=tr=lr=0;
set_pwm1_duty (150);
while(d==kt);
{delay_ms(2000);
lui_20();}}
while((d>=9)&(d<=11))/
{di_thang();}}

void lui_20()
{ tl=tr=0;
ll=lr=1;
set_pwm1_duty (150);
while(d==6)
{delay_ms(2000);
queo_trai();}}

void main()
{
set_tris_c(0b00000100);
set_tris_b(0b11110001);
set_tris_d(0x00);
enable_interrupts(int_ccp1);
enable_interrupts(global);
setup_ccp1(CCP_CAPTURE_RE);
enable_interrupts(global);
setup_timer_1(T1_INTERNAL);
setup_ccp2(CCP_PWM);
enable_interrupts(int_RB);
ext_int_edge(H_to_L);
set_timer1(0);
LCD_init();
while(1)

{
If(kc>=35)
{di_thang();}
else if (kc<35)
{ delay_ms(1000);
queo_trai();}}}
huyckc vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
 

Tags
function identifier lỗi

Ðiều Chỉnh
Xếp Bài

Quyền Sử Dụng Ở Diễn Ðàn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Smilies đang Mở
[IMG] đang Mở
HTML đang Tắt

Chuyển đến


Múi giờ GMT. Hiện tại là 06:32 PM.


Được sáng lập bởi Đoàn Hiệp
Powered by vBulletin®
Page copy protected against web site content infringement by Copyscape
Copyright © PIC Vietnam