Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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
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?
 

maybe you didn't make a separte project folder for your aplication.. Ar e you using mikRoC ver 6?
 

    bbgil

    Points: 2
    Helpful Answer Positive Rating
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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top