View Single Post
  #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.