Go to Post Attitudes in one part of life tend to carry over to others. - Wetzel [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
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
  #1   Spotlight this post!  
Unread 17-04-2006, 20:31
CircularLogic CircularLogic is offline
Registered User
FRC #1546 (Chaos Inc)
Team Role: Leadership
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Baldwin
Posts: 38
CircularLogic will become famous soon enoughCircularLogic will become famous soon enough
Programming question

A couple of weeks ago, I wrote some code just to test out motor direction and then from there decided to write "real" code in the same file. Because easyC does not allow me to edit the text, I couldnt find a way to comment the test section of the code so I just made it an invalid while loop. (while(1==0)).

So when I ran the code, I noticed there was a rhythmic beep and silence pattern which corresponded to the same type of rhythmic motor control and lack of control. I figured out that it was the invalid while loop that was doing it.


Now I am experiencing a similar problem, but the rhythm of no control is much shorter. The only part of the code that would ever not be operation is a fairly large if statement. Is it possible for that if statement to cause a break in the code? Or could it have something to do with an undefinied variable?

#include "UserAPI.h"

int a = 0;
int b = 0;
int c = 0;

void main ( void )
{
while ( 1 )
{
MotorRcControl ( 0 , 2 , 3 , 0 ) ;
MotorRcControl ( 0 , 3 , 4 , 1 ) ;
MotorRcControl ( 0 , 6 , 1 , 1 ) ;
a = GetRxInput ( 1 , 5 ) ;
if ( a>127 )
{
SetPWM ( 2 , 160 ) ;
PrintToScreen ( "154\n" ) ;
}
else
{
if ( a<127 )
{
SetPWM ( 2 , 90 ) ;
PrintToScreen ( "100\n" ) ;
}
else
{
SetPWM ( 2 , 127 ) ;
PrintToScreen ( "127\n" ) ;
}
}
b = GetRxInput ( 1 , 6 ) ;
if ( b>127 )
{
SetPWM ( 1 , 144 ) ;
}
else
{
if ( b<127 )
{
SetPWM ( 1 , 110 ) ;
}
else
{
SetPWM ( 1 , 127 ) ;
}
}
}
}
__________________
Team 1546 Chaos Incorporated
2005- SBPLI Rookie All Stars
2006- SBPLI Sportsmanship award.

Gotta hand it to the straight line autonomous mode, the most effective defense out there.

Proud beyond belief of the accomplishments of the second year, 20th ranked, 6 wins and 6 losses Chaos Incorporated.
Reply With Quote
 


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
VEX programming Gene F Programming 14 08-08-2006 22:21
Servo behavior question / advanced servo/PIC programming question DanL Electrical 12 18-10-2005 18:33
have a question to ask about Double Solenoids to one spike programming davelu Programming 3 22-02-2005 09:52
General programming question mikesown Programming 1 07-02-2005 16:09
'Fix It Window' and Programming.... JMac Programming 19 25-01-2005 18:57


All times are GMT -5. The time now is 17:49.

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