Go to Post Anything worth analyzing is worth over-analyzing. And anything worth over-analyzing is worth hyper-analyzing. Ready, go! - Michael Hill [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 08-02-2012, 21:40
korsuk19's Avatar
korsuk19 korsuk19 is offline
Registered User
FRC #3734 (Caxy's)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Lake Forest, Illinois
Posts: 14
korsuk19 is an unknown quantity at this point
cRIO not functioning

so I am the new programmer for my team. problem is I'm new to this FRC thing.
At the moment I am trying to code our robot so that we can drive in tank drive, and have a relay spike control one of our motors (in the future have 3 relay spikes control 3 motors) that will bring the ball off ground like a crane.

This is my code:
// Define user inputs
Joystick leftStick = new Joystick(1);
Joystick rightStick = new Joystick(2);

// Define the motor controllers. Uses the Jaguar PWM Modules
Jaguar left = new Jaguar(1);
Jaguar right = new Jaguar(2);
RobotDrive drive = new RobotDrive(1, 3, 2, 4);
//relay modules please
Relay lowBall = new Relay(5);
//Relay upBall = new Relay(6); //future 2 relay's
//Relay shootBall = new Relay(7);

public void operatorControl() { //new control
//
//----------
// Human Operation Mode
//----------
while (isEnabled()) {
//
Watchdog.getInstance().feed();

DriverStationLCD.getInstance().updateLCD();

drive.tankDrive(leftStick, rightStick);
// if button pressed reverse the specified ballMotor.
if(leftStick.getRawButton(2))
lowBall.set(Relay.Value.kReverse);
else
lowBall.set(Relay.Value.kForward);

//if(leftStick.getRawButton(3))
// upBall.set(Relay.Value.kReverse);
//else
// upBall.set(Relay.Value.kForward);

//if(rightStick.getTrigger())
// shootBall.set(Relay.Value.kForward);
//else
// shootBall.set(Relay.Value.kOff);
}
}
I have all the necessary imports, I hope, here they are if it helps:
import edu.wpi.first.wpilibj.camera.AxisCamera;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Watchdog;
import edu.wpi.first.wpilibj.DriverStationLCD;
import edu.wpi.first.wpilibj.Joystick.AxisType;

Issue:
for some reason, after this code is uploaded to the cRIO, nothing happens.
nothing functions, I cannot even drive it, no motors work, nothing works.
I've tried many things, like switching from, extends SimpleRobot, to extends IterativeRobot. I've checked, re-installed, re-everything the plug-ins and what not. We have connection, and our computer is talking with the cRIO. But still nothing happens.

Question:
Does anyone know why our cRIO (robot) isn't functioning? thanks for the help in advance.
__________________
just wanna learn

Last edited by korsuk19 : 09-02-2012 at 20:19. Reason: typo's
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 08:33.

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