This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ADC for IR sensor ..error C67:DP5 Undefined identifier

Hi there,

Just went through discussions, but could not get any satisfactory thread.

I want to control 3 IR sensors and a Ultrasonics.

For IR, I tried to configure port 5, but, it gives error "C67:DP5 Undefined identifier "

the code was:
----------------------------------------------------

#include <reg167.h>

sbit DP5_0 = DP5^0;
sbit DP5_1 = DP5^1;
sbit DP5_2 = DP5^2;
sbit DP5_3 = DP5^3;

unsigned int GetReading (unsigned char channel)
{ ADCON = 0xB000;
ADCON |= channel & 0x000F; /* Select channel to
ADST = 1; /* Begin conversion
while (ADBSY == 1); /* Wait while the
return (ADDAT & 0x03FF)
}

void Get_Signal (void)

{ unsigned char i; unsigned int result;

DP5 = 0x000F;
P5_1 = 0;

while(1) { for (i = 0; i < 16; i++) { result = GetReading (i); } }

void main(void)
{ Get_Signal ();
for(;;)
; }

-------------------------------------------------------
I am using uVision 3.

I would really appreciate if I get an expert's opinion.

Thank you.

Amit

Parents Reply Children
No data