Help Error message:"A numeric expression must to appear
Posted: Thu Apr 12, 2012 1:23 pm
Hi, I need your your help. I can't find the problem with the following code. I tried to put {} because I read that someboody do this but it doesn't work. Its a program for control a robotic arm with PAP motors, that is activated with push-buttons. Well here is it:
void main (void) <----------this is the body of the program
{ and here its the error.
inicializar();
while(TRUE){
if (RA0==1){
mp1d();
}
else
{ mp1i();
}
if (RA1==1)
{mp1i();}
if (RA2==1)
{mp2d();}
if (RA3==1)
{mp2i();}
if (RA4==1)
{mp3d();}
if (RA5==1)
{mp3i();}
if (RE0==1)
{m4d();}
if (RE1==1)
{m4i();}
if (RE2==1)
{m4d();}
if (RC0==1)
{m4i();}
}
}
}
------------------------------these are the functions-----------------------
void mp1d(void) //motor a pasos 1 derecha//
{
while(RA0==1){
RB0==1;
delay_ms(500);
RB1==1;
delay_ms(500);
RB2==1;
delay_ms(500);
RB3==1;
delay_ms(500);
}}
void inicializar(void)
{
set_tris_A(0b111111);
set_tris_B(0b00000000);
set_tris_C(0b10000000);
set_tris_D(0b00000000);
set_tris_E(0b111); //At this point, you have not ended the declaration
//of the function 'inicializar' - no close bracket
void main (void) <----------this is the body of the program
{ and here its the error.
//You now try to declare 'main' _inside_ the already declared function.
//Of course the compiler complains.....
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum