problem on programming

Status
Not open for further replies.

funngun012

New Member
I did wrong on the void start ,and void stop part, anyone can help me? Thank u so much.........
void main()
{
while(1)
{
printf("Press start or stop\n");
void start();----->wrong
void stop();------>error
}
}

void start()
{
motor(1,2.0);
fd(1);
printf("Forward\n");
sleep( 2.0);
off(1);
printf(" stop\n");
sleep(1.0);
bk(1);
printf("Reverse\n");
sleep(2.0);
ao();
beep();
beep();
printf("End");
}

void stop()
{
float EM;
EM=0.0;
EM=time();
while( time()<EM+15.0)
{
knob();
printf("\n%d",knob());
sleep(15.0);
}
beep();
beep();
}
 
it's a robatic program, and this is the information below:
Program your HandyBoard using Interactive C 4.0 to respond to the following actions:
Action1 Response
Pressing the “Start Button” - Beep
- Motor 1 LCD
Forward for 2 sec “Forward”
Stop for 1 sec “Stop”
Backward for 2 Sec “Back”
End “End”
- Beep Twice and End
Pressing “Stop Button” - Beep
- Knob LCD
Turn knob Display value of knob2
- Wait 15 sec then Beep Twice and End
 
The 'void' is only required for the prototype. If you call the function you should leave the 'void' out.

Also, the function's prototype should be placed above main, or at least a copy of it so that it is already declared before you call it.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…