Go to Post FIRST is the only high-school sport where everyone can become a pro - David Brinza [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 23-06-2008, 16:31
Kuiper Kuiper is offline
ManicMechanic's progeny
AKA: Justin
FTC #0438 (Metal Gear)
Team Role: Mechanical
 
Join Date: May 2008
Rookie Year: 2003
Location: GMT -8
Posts: 4
Kuiper is an unknown quantity at this point
Send a message via AIM to Kuiper Send a message via Yahoo to Kuiper
User code (syntax error, help?)

Right now, I'm trying to create a program that commands a robot to move forward while constantly monitoring the status of two limit switches. If the left limit switch is pressed, the robot backs up and turns right before resuming forward motion, and if the right limit switch is pressed, the robot backs up and turns left before resuming forward motion. This is repeated infinitely (or until 5 stops being equal to 5). Only problem is that I'm getting a compile error:
Quote:
Error[yy] Main.c line# 16 : syntax error
I've tried a various number of permutations of commands to try to download it and it seems that the problem may be with the User Code block (used in lines 15 and 20) in which I assign a value to a variable called "sum" equal to the sum of two variables known as "left" and "right".

Here's the program, both the EasyC window and the C window:





If anyone can shed some light on this matter, it would be much appreciated.
  #2   Spotlight this post!  
Unread 23-06-2008, 16:48
Travis Hoffman's Avatar Unsung FIRST Hero
Travis Hoffman Travis Hoffman is offline
O-H
FRC #0048 (Delphi E.L.I.T.E.)
Team Role: Engineer
 
Join Date: Sep 2001
Rookie Year: 2001
Location: Warren, Ohio USA
Posts: 4,045
Travis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond repute
Re: User code (syntax error, help?)

Pertaining to the syntax error:

Are you missing a semicolon after each "sum = left + right" statement?
__________________

Travis Hoffman, Enginerd, FRC Team 48 Delphi E.L.I.T.E.
Encouraging Learning in Technology and Engineering - www.delphielite.com
NEOFRA - Northeast Ohio FIRST Robotics Alliance - www.neofra.com
NEOFRA / Delphi E.L.I.T.E. FLL Regional Partner
  #3   Spotlight this post!  
Unread 23-06-2008, 18:33
Kuiper Kuiper is offline
ManicMechanic's progeny
AKA: Justin
FTC #0438 (Metal Gear)
Team Role: Mechanical
 
Join Date: May 2008
Rookie Year: 2003
Location: GMT -8
Posts: 4
Kuiper is an unknown quantity at this point
Send a message via AIM to Kuiper Send a message via Yahoo to Kuiper
Re: User code (syntax error, help?)

That was exactly the problem, as it turns out. Adding semicolons elliminated the syntax error and made it possible for me to download the program. Thanks!
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
180:Error: syntax error help! seanl Programming 8 04-02-2007 11:31
C18 v2.4 -- Syntax error where there is no syntax error Joel J Programming 7 12-01-2007 17:27
syntax error in code that i have never even seen before: HELP! pbhead Programming 10 24-02-2006 14:22
Syntax Error! Denz Programming 15 04-02-2006 23:57


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

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