Go to Post People will only work toward common goals when they are part of the goal-setting process. - GaryVoshol [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 06-02-2007, 14:27
Ultima Ultima is offline
Registered User
FRC #0369
 
Join Date: Oct 2005
Location: Brooklyn, NY
Posts: 26
Ultima will become famous soon enough
Re: OI Input Autonomous

I have a few questions. Well first of all I edited the code and this is what it looks like now as I try to compile:

Quote:
void auton_select(void)
{
static char last_sw1;
static char last_sw2;

if(p1_sw_trig == 1 && p1_sw_trig != last_sw1)
{
if(auton_select < 2)
{
auton_select++;
}
else
{
auton_select=99;
}
}
if(p1_sw_top == 1 && p1_sw_top != last_sw2 && auton_select > 0)
{
if (auton_select == 94)
{
auton_select= 2 ;
}
else
{
auton_select--;
}
}
last_sw1 = p1_sw_trig; //oneshot the trigger and top buttons
last_sw2 = p1_sw_top;

User_Mode_Byte = auton_select;
}
Second of all, how would I got about declaring auton_select as a global variable, and third I would need to get around the following errors:

Quote:
C:\2007 arm code\FrcCode2005v2.4\user_routines.c:661:Error [1128] compatible scalar operands required for comparison
C:\2007 arm code\FrcCode2005v2.4\user_routines.c:663:Error [1147] scalar type expected for increment operator
C:\2007 arm code\FrcCode2005v2.4\user_routines.c:667:Error [1131] type mismatch in assignment
C:\2007 arm code\FrcCode2005v2.4\user_routines.c:670:Error [1128] compatible scalar operands required for comparison
C:\2007 arm code\FrcCode2005v2.4\user_routines.c:672:Error [1128] compatible scalar operands required for comparison
C:\2007 arm code\FrcCode2005v2.4\user_routines.c:674:Error [1131] type mismatch in assignment
C:\2007 arm code\FrcCode2005v2.4\user_routines.c:678:Error [1148] scalar type expected for decrement operator
C:\2007 arm code\FrcCode2005v2.4\user_routines.c:684:Error [1105] symbol 'User_Mode_Byte' has not been defined
C:\2007 arm code\FrcCode2005v2.4\user_routines.c:684:Error [1101] lvalue required
The code is from 2005 since we are just testing our prototype arm with the 2005 controller.
 


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
User Input railerobotics Programming 4 29-08-2006 00:54
Powered OI input EricS-Team180 Programming 7 28-09-2003 21:23
Graphic Input Raven_Writer Computer Graphics 7 08-08-2003 15:43
Autonomous user-input loophole? Jeff McCune Programming 20 14-02-2003 22:44
2.5 is alive !!!! (input ! .. more input ! ) Lloyd Burns Programming 2 14-01-2003 19:15


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

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