undeclared variable error in MikroC

Status
Not open for further replies.

bbgil

Full Member level 2
Joined
Mar 11, 2006
Messages
135
Helped
13
Reputation
26
Reaction score
9
Trophy points
1,298
Visit site
Activity points
2,321
hi. I can't figure out why this code has an undeclared variable when it is defined already in the array. just trying out C for pic16f877a using tables. Is there a problem on how to use pointer or the variable are not matching? any help is appreciated

unsigned short i;
const char Table[11] = {0x12, 0xf3, 0x0f, 0x12, 0xf3, 0x25, 0x10, 0x0f, 0x0c,
0x25, 0x0f};

void main() {
TRISB= 0; // PORTB is output
porta=0;
trisa=0;
PORTb = 0xFF; // Initialize PORTB

while (1)
{
for (i = 0; i<=10u; i++) {
porta = 2;
PORTB = Table(i);
Delay_ms (1000);
porta=0;
Delay_ms (1000);

}
}
}
 

hi. followed ur advised. it compiled but now the error is missing system.c file when i simulate it. Why?
 

neo,

works now but using simulation, still gets the system.c error even if a put on separate folder. usign mikroC v.6. thnx for the input.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…