Some problems were mentioned above, which may/may noe be duplicated here.
Code:
int main() // put "main(void)" instead
{
// Welcome message
printf("Welcome to RoboSimoClient\n\n");
// Ask user for server IP address, then connect to it
int counter;
int a, b, c, d, port;
printf("Please enter server IP address: ");
scanf("%d.%d.%d.%d", &a, &b, &c, &d);
printf("Please enter port number: ");
scanf("%d", &port);
connect_to_server(a, b, c, d, port); //function doesnt exist (if it does, you should have included it in your post!)
// circle the arena
while(1)
{
set_motor_speeds(100,100); // function doesnt exist
counter = 1;
while(read_analog_channel(0) < 120 && read_analog_channel(1) < 120); // you probably dont want this trailing semicolon; also the function your calling doesnt exist
{
set_motor_directions(1, 1); // function doesnt exist
}
set_motor_directions(0, 0);
if(read_analog_channel(0) > 120 && read_analog_channel(1) < 120); // trailing semi colon probably not wanted
{
while(counter > 0); // semicolon
{
if(read_analog_channel(0) > 120 && read_analog_channel(1) < 120)
{
set_motor_directions(1, 0);
}
else
{
set_motor_directions(1, 1);
}
counter = counter + 1;
// missing close bracket
}
if(read_analog_channel(0) < 120 && read_analog_channel(1) > 120); //semi colon
{
while(counter > 0); // what the hell
{
if(read_analog_channel(0) < 120 && read_analog_channel(1) > 120)
{
set_motor_directions(0, 1);
}
else
{
set_motor_directions(0, 0);
}
counter = counter + 1;
// missing close bracket for while loop
}
}
return 1;
}