Go to Post I could say that the decline in the population of pirates is responsible for global warming, the statistics correlate, but its obvious there's no causation there. - Racer26 [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
  #3   Spotlight this post!  
Unread 22-01-2014, 14:37
sthreet's Avatar
sthreet sthreet is offline
Registered User
AKA: scott threet
FRC #4692
 
Join Date: Oct 2012
Rookie Year: 2012
Location: Toutle Lake
Posts: 84
sthreet is an unknown quantity at this point
Re: [cRIO] Robot Drive... Output not updated often enough.

Sorry I didn't reply yesterday, internet was broken.

Spoiler for log after xyz default running messege:

[cRIO] task 0xca7f88 (worker.0) deleted: errno=0 (0) status=0 (0)

[cRIO] edu.wpi.first.wpilibj.networktables2.server.Server ConnectionAdapter@b entered connection state: GOT_CONNECTION_FROM_CLIENT

[cRIO] edu.wpi.first.wpilibj.networktables2.server.Server ConnectionAdapter@b entered connection state: CONNECTED_TO_CLIENT

[cRIO] Robot Drive... Output not updated often enough.

[cRIO] edu.wpi.first.wpilibj.networktables2.server.Server ConnectionAdapter@b entered connection state: CLIENT_DISCONNECTED

[cRIO] Close: edu.wpi.first.wpilibj.networktables2.server.Server ConnectionAdapter@b


Here is code: (deleted commented stuff.) (I'm fairly certain this is the same code that I posted, but I uncommented and recommented stuff so it may have changed. I was running this code. There is more complicated stuff commented out, but not to bad, just commented stuff out that wasn't actually connected to the digital sidecar/whatnot yet.)
Code:
package edu.wpi.first.wpilibj.templates;


import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Joystick;

public class team4692robot extends SimpleRobot 
{
    RobotDrive drive = new RobotDrive(1, 2);
    Joystick left = new Joystick(1);
    Joystick right = new Joystick(2);

    public void autonomous() 
    {
        int autotimer=0;
        
        while(true && isAutonomous() && isEnabled())
        {
            if(autotimer<100)
            {
                drive.tankDrive(.4, -.4);
            }
            else
            {
                drive.tankDrive(0, 0);
            }
            
            autotimer++;
            Timer.delay(.005);
        }
    }

    public void operatorControl() 
    {  
        while(true && isOperatorControl() && isEnabled())
        {
            double leftpow=left.getY(); double rightpow=right.getY();
            double powermod=.25;
            if(left.getTrigger())
            {
                powermod+=.25;
            }
            if(right.getTrigger())
            {
                powermod+=.5;
            }
            leftpow*=powermod; rightpow*=powermod;
            
            drive.tankDrive(leftpow, rightpow); 
            Timer.delay(.005);
        }
    }

    public void test() 
    {
    
    }
    
}
__________________
Spoiler for gif:
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 13:25.

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