Go to Post Use the mentor to lay down the law. They're not there to be your friends they're there to keep the kids focused on the job at hand. - Koko Ed [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 01-07-2015, 00:05
jtrv's Avatar
jtrv jtrv is offline
github.com/jhtervay
AKA: Justin
FRC #2791 (Shaker Robotics)
Team Role: College Student
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Latham, NY
Posts: 144
jtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to all
DoubleSolenoid question

Alright, so i'm working on just re-writing our 2015 robot's code so that it's a lot cleaner and whatnot, so future students can see a good example of a good project.

my question - one that i ran into during build season but never tested - is this: if i instantiate a double solenoid object, then put it in the Value.kForward position manually in teleop, then turn the bot off and re-upload the code, will the code be able to recognize that it is in the Value.kForward position during disabled?

the order of code being run:

first time:
Code:
public void RobotInit(){
    piston = new DoubleSolenoid( ... , ...);
}
// then:
public void TeleopInit(){
   piston.setValue(Value.kForward);
}
// then i power off the bot while piston is in forward position, and this happens after i turn it on again and reupload code:
public void RobotInit(){
   piston = new DoubleSolenoid( ... , ...);
}
// then in disabledPeriodic
public void DisabledPeriodic(){
    if(piston.get() == Value.kForward)
        System.out.println("it's in the forward position");
    else
        System.out.println("it isn't or we don't know");
}
what would print in the example?
__________________
2791 (2012-2017)
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:43.

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