Problem With Programming Help Needed

4 replies [Last post]
Botballgirl0828
Title: NooBot
Joined: 03/20/2012
Posts:
BotPoints: 5
User offline. Last seen 10 years 18 weeks ago.

My team and I are entering in the 2012 botall tournament in Hawaii. For our programming we have faced an unusual error,

error: expected identifier or '(' before '{' token

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
Posts:
BotPoints: 1168
User offline. Last seen 7 years 13 weeks ago.

Hi, welcome to the Botball Community!

Sounds like you're missing a parenthesis. Can you post about 5-6 lines of the code surrounding the line where the error shows up? It's hard to diagnose without looking at the code.

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS

Botballgirl0828
Title: NooBot
Joined: 03/20/2012
Posts:
BotPoints: 5
User offline. Last seen 10 years 18 weeks ago.

Thank You for getting back to me! here are five lines of our program.

int main();
{
int printf("Drive Straight\n"); // announce the program
sleep(1.0); // wait 1 second
while (create_connect()); // Open the connection between CBC and Create
// As long as the create has not driven 1m
while (get_create_distance(0.5) < 200)
{
create_drive_direct(500,500); // Drive forward at 250mm/sec
}

Also we are trying to add the motors into our program but we are unsure how to get it, here is our program so far, included what we THINK is the correct thing for the motor. We are trying to add a motor after it goes forward, then 90 degrees counterclockwise, and the forward again. At that point we want to add a motor, please help.

int main()
{
printf("Drive Straight\n"); // announce the program
sleep(1.0); // wait 1 second
while (create_connect()); // Open the connection between CBC and Create
// As long as the create has not driven 1m
while (get_create_distance(0.1) < 90)
{
create_drive_direct(500,500); // Drive forward at 250mm/sec
}
mav(0,100);
sleep(1.0);
printf("Drive 60 degrees clockwise\n"); // announce the program
sleep(1.0); // wait 1 second
while (create_connect()); // Open the connection between CBC and Create
// While the Create's angle has not changed by 90 degrees clockwise
while (get_create_total_angle(0.1) > -260)
{
// Tell the Create to spin clockwise at a speed of 100mm/sec
create_drive_direct(-500, 500);
}
{
create_drive_direct(700,700); // Drive forward at 250mm/sec
}
printf("Drive 90 degrees counter clockwise\n"); // announce the program
sleep(1.0); // wait 1 second
create_stop(); // Stop the Create
create_disconnect(); // Disconnect the Create
printf("All Done\n"); // Tell user program has finished
}

Beta
Beta's picture
Title: The Magnificent
Joined: 02/24/2012
Posts:
BotPoints: 266
User offline. Last seen 8 years 26 weeks ago.

The problem with the first code sample is that you have an extraneous semicolon after int main(). Removing that semicolon and just having curly brackets like you already have should fix your problem.

Correct:

  1. int main()
  2. {
  3. ...
  4. }

Braden McDorman

Developer of the KIPR Link, KISS IDE, KIPR's 2D Simulator, and CBCJVM.

Reach me at bmcdorman(cat)kipr(dog)org where (cat)=@ and (dog)=. if you need assistance of any kind.

milanjoy
Title: NooBot
Joined: 06/13/2017
Posts:
BotPoints: 266
User offline. Last seen 2 hours 38 min ago.

Good to see the details regarding the programming help services details you have shared Peter Veres here. There are so many such services capable of doing your work at the right time. You must be more concentrated on doing assignments on programing subjects and I am looking here for more updates on that.