Go to Post Just remember: the tubes aren't a life saving device, the are a life CHANGING device! - Koko Ed [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 22-03-2004, 10:02
omega's Avatar
omega omega is offline
Registered User
#1352
 
Join Date: Mar 2004
Location: Stratford Northwestern
Posts: 11
omega is an unknown quantity at this point
how are we going to do this

This is what we have for our automous code but we want to go from the Navigate(); to what is beneath it when both of the sensors see nothing becuase we don't want to risk loseing all of that time.



void User_Autonomous_Code(void)
{
while (autonomous_mode) /* DO NOT CHANGE! */
{
if (statusflag.NEW_SPI_DATA) /* 26.2ms loop area */
{
Getdata(&rxdata); /* DO NOT DELETE, or you will be stuck here forever! */

/* Add your own autonomous code here. */

Navigate();

if(rc_dig_in01 ==1 )
{
pwm13 = 137;
pwm14=100;
}
else
{
pwm13 = pwm14 = 140;
}
if(rc_dig_in02 == 1)
{
pwm13 = 100;
pwm14 = 137;
}
else
{
pwm13 = pwm14 = 140;
}

Generate_Pwms(pwm13,pwm14,pwm15,pwm16);

Putdata(&txdata); /* DO NOT DELETE, or you will get no PWM outputs! */
}
}
}
  #2   Spotlight this post!  
Unread 22-03-2004, 10:44
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
Re: how are we going to do this

Quote:
Originally Posted by omega
This is what we have for our automous code but we want to go from the Navigate(); to what is beneath it when both of the sensors see nothing becuase we don't want to risk loseing all of that time.
I think you said it yourself, just say it in C:

Code:
void User_Autonomous_Code(void)
{
  while (autonomous_mode)   /* DO NOT CHANGE! */
  {
    if (statusflag.NEW_SPI_DATA)      /* 26.2ms loop area */
    {
        Getdata(&rxdata);   /* DO NOT DELETE, or you will be stuck here forever! */

        /* Add your own autonomous code here. */
   
   Navigate();   

  if ( NEITHER_SENSOR_SEES )
  {
   if(rc_dig_in01 ==1 )
     {
    pwm13 = 137;
    pwm14=100;
    }
     else
    {
    pwm13 = pwm14 = 140;
    }
   if(rc_dig_in02 == 1)
    {
    pwm13 = 100;
    pwm14 = 137;
    }
   else
    {
    pwm13 = pwm14 = 140;
    }
   } 
   Generate_Pwms(pwm13,pwm14,pwm15,pwm16);

        Putdata(&txdata);   /* DO NOT DELETE, or you will get no PWM outputs! */
    }
  }
}
However, it may be more appropriate to change Navigate() to keep going when blind. Are you using IR trackers?
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the USPTO.
My favorite error message from gcc: main is usually a function
My favorite error message from Windows: There is not enough disk space available to delete this file.
  #3   Spotlight this post!  
Unread 22-03-2004, 11:32
Kevin Karan's Avatar
Kevin Karan Kevin Karan is offline
Linux Guy
AKA: maxdamage
None #0174 (Arctic Warriors)
Team Role: Alumni
 
Join Date: Jan 2003
Location: Liverpool, NY
Posts: 141
Kevin Karan will become famous soon enoughKevin Karan will become famous soon enough
Send a message via AIM to Kevin Karan
Re: how are we going to do this

You should move navigate() to before the spidata thing if you are using the old navigate routine
__________________
It isnt ALWAYS the programmers falt!
2004: Buckeye team website award
2002: Rutgers semi-finalists
2001: National semi-finalists
2001: Rutgers semi-finalists
1998: Manchester Rookie All-Star Award
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


All times are GMT -5. The time now is 02:52.

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