Go to Post Technology is everywhere, yet the human factor is what makes an event special. - synth3tk [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-01-2008, 06:56
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,517
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Program a motor to turn on and off every other second.....

You can't have two else statements like that.

It's

if
else if
else

If you need it longer, it's

if
else if
else if
else if
else
  #2   Spotlight this post!  
Unread 29-01-2008, 07:32
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Program a motor to turn on and off every other second.....

Look for a missing semicolon or close brace on the line immediately before what you've shown us. If you don't see anything wrong, consider attaching the entire user_routines.c file so we can look through it.
  #3   Spotlight this post!  
Unread 29-01-2008, 07:41
programmr's Avatar
programmr programmr is offline
Registered User
AKA: Face
FRC #0522
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Staten Island, NY
Posts: 83
programmr is a jewel in the roughprogrammr is a jewel in the roughprogrammr is a jewel in the rough
Send a message via AIM to programmr
Re: Program a motor to turn on and off every other second.....

THANKS TO ALL FOR HELPING ME! YOU GUYS ARE GREAT!
  #4   Spotlight this post!  
Unread 29-01-2008, 09:25
Chaos in a Can Chaos in a Can is offline
Joel Spadin
FRC #1736 (Robot Casserole)
Team Role: Programmer
 
Join Date: Mar 2007
Rookie Year: 2007
Location: Peoria, IL
Posts: 58
Chaos in a Can is an unknown quantity at this point
Send a message via MSN to Chaos in a Can
Re: Program a motor to turn on and off every other second.....

Quote:
Originally Posted by Tom Line View Post
You can't have two else statements like that.
Look at the code again.
It's lost its indentation, so it's hard to see, but the code is perfectly fine.
The second else belongs to the first of two if's.


I'm guessing the problem is not in line 232, but somewhere before that line.
The compiler was expecting something like a semicolon at the end of a previous line, but didn't complain about it until it found the start brace in line 232, which it wasn't expecting.
Look over the code just before "void code()".
__________________
2006 Xerox Creativity Award
2007 General Motors Industrial Design Award
2008 Judges' Award
2009 Chrysler Team Spirit Award

  #5   Spotlight this post!  
Unread 29-01-2008, 10:14
programmr's Avatar
programmr programmr is offline
Registered User
AKA: Face
FRC #0522
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Staten Island, NY
Posts: 83
programmr is a jewel in the roughprogrammr is a jewel in the roughprogrammr is a jewel in the rough
Send a message via AIM to programmr
Smile Re: Program a motor to turn on and off every other second.....

THANK YOU TO ALL WHO HELPED ME.. IT WORKS NOW!!! THANK YOU AGAIN!
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Turn off outlining? Justin M. Inventor 11 01-02-2007 09:16
How fast does the Solenoids turn on and off? Generalx5 Robotics Education and Curriculum 2 26-01-2007 01:09
Anyone know how fast the Solenoids on the MINI RC can turn on and off? Generalx5 Control System 1 06-01-2007 07:39
Program machine to turn and stop CharlieWilken Programming 1 19-02-2004 12:50
hanging off off other robots that are hanging off the horiz bar Andrew Dahl Rules/Strategy 15 12-01-2004 19:14


All times are GMT -5. The time now is 08:44.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi