Go to Post I will read this blog, read your stories, learn from you, and be a better mentor because of you. You give me hope. Your diversity brings me joy. - Carolyn_Grace [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 15-01-2012, 13:52
That Canadian That Canadian is offline
Registered User
FRC #0346 (RoboHawks)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Chesterfield
Posts: 13
That Canadian is an unknown quantity at this point
Digital Sidecar Control Not Working

My team and I have been trying to get our old robot running and the Digital Sidecar isn't responding to I/O commands. I can control a relay (spike) just fine, but we can't control the victor at all. It's just flashing orange. We know the PWM cable is good and the code is just very simple and should work. Also every node from the Digital I/O section of the Digital sidecar is giving out a constant 5v. Any help appreciated, I'll also post my code here in-case that may be the problem.
Code:
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

package edu.wpi.first.wpilibj.templates;


import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.Victor;

/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the IterativeRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class RobotTemplate extends IterativeRobot {
    /**
     * This function is run when the robot is first started up and should be
     * used for any initialization code.
     */
    //ADXL345_I2C accel;
    Relay spike;
    Joystick joy;
    Victor vict;
    public void robotInit() {
        //accel = new ADXL345_I2C(1,ADXL345_I2C.DataFormat_Range.k2G);
        spike = new Relay(1);
        vict = new Victor(1);
        joy = new Joystick(1);
    }

    /**
     * This function is called periodically during autonomous
     */
    public void autonomousPeriodic() {

    }

    /**
     * This function is called periodically during operator control
     */
    public void teleopPeriodic() {
        //System.out.println("Acceleration X: " + accel.getAcceleration(ADXL345_I2C.Axes.kX));
        System.out.println("Joystick Y:" + joy.getY());
        vict.set(joy.getY());
        
        if(joy.getAxis(Joystick.AxisType.kY)<0)
        {
            spike.set(Relay.Value.kForward);
            System.out.println("Spike reverse");
        }
        else if(joy.getAxis(Joystick.AxisType.kY)>0)
        {
            spike.set(Relay.Value.kReverse);
            System.out.println("Spike reverse");
        }
    }
    
}

Last edited by That Canadian : 15-01-2012 at 13:55.
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:32.

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