Go to Post I love the smell of a upcoming FRC build season in the morning. The sleepless night; the drills; welding; cutting of metal. I wait all yr. for this. - midway78224 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 18-02-2011, 21:38
sp33chy sp33chy is offline
Registered User
FRC #3332
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Melbourne, FL
Posts: 29
sp33chy is an unknown quantity at this point
I hate Autonomous programming! Why is it so sporadic?

Code:
    public void autonomous() {
        xmove=.25;
        autonomousTimer.start();
        autonomousTimer.reset();
        while(true){
        if(photoSwitch.get()){
            topLeft.set(xmove);
            topRight.set(-xmove);
            bottomLeft.set(xmove);
            bottomRight.set(-xmove);
        }
        if(!photoSwitch.get())
            {
            topLeft.set(0);
            topRight.set(0);
            bottomLeft.set(0);
            bottomRight.set(0);
        }
        if(autonomousTimer.get()>15.0){
            topLeft.set(0);
            topRight.set(0);
            bottomLeft.set(0);
            bottomRight.set(0);
            break;
        }
            Watchdog.getInstance().feed(); //Gotta feed that watchdog

        }
    }
Sometimes, the code works as it's supposed to be, It (the bot)stops when it reaches the end of the line. Sometimes it keeps going indefinitely, and sometimes and it doesn't move. This makes no sense to me. I've been pulling my hair out as to why it keeps doing this. Any help would be appreciated.
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


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

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