Go to Post I think this is the forest that ChiefDelphi often misses as we're picking the branches off every tree. - Libby K [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-11-2013, 04:25 PM
y-aji y-aji is offline
Registered User
FRC #3734
 
Join Date: Dec 2011
Location: Lake Forest
Posts: 38
y-aji is an unknown quantity at this point
Talon not responding

I think we have everything set up for the Talons. Can someone confirm that the following is correct?

I have tested the motor as good. The Talon sits blinking orange, never confirming it is receiving signal from PWM.

Code:
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Talon;

public class AwesomOSimple extends SimpleRobot {

    Talon frisbeeIndexer;

    public void robotInit() {
        frisbeeIndexer = new Talon(9);
    }

    public void operatorControl() {
        frisbeeIndexer.set(1.0);
    }
}
Is there more needed than that? I feel like you have to enable it. I see there is an option to disable it (frisbeeIndexer.disable()). I've tried 0.9 and a simple 1, but nothing. Any thoughts?

I'm going to check that no one plugged something in backwards tonight, so that's still up in the air, I just wanted to cover the software.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-11-2013, 06:19 PM
cgmv123's Avatar
cgmv123 cgmv123 is offline
FRC RI/FLL Field Manager
AKA: Max Vrany
FRC #1306 (BadgerBOTS)
Team Role: College Student
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Madison, WI
Posts: 2,069
cgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond repute
Re: Talon not responding

operatorControl() is only called once. If you want to actually do something, you have to make a loop.

Code:
public void tele()
{
   frisbeeIndexer.set(1.0);
}


//Don't modify the following method
public void operatorControl()
{
 while (isOperatorControl())
 {
    tele();
    Timer.delay(3/1000); //this prevents the cRIO from becoming overloaded, especially if tele() is empty
 }
}
Having tele() as a separate method keeps things clearer and keeps inexperienced programmers from messing with something they shouldn't, but you're more than welcome to have everything in operatorControl().
__________________
BadgerBOTS Robotics|@team1306|Facebook: BadgerBOTS
2016 FIRST Championship Tesla Division | 2016 Wisconsin Regional Engineering Inspiration Award

2015 FIRST Championship Carson Division | 2015 Wisconsin Regional Chairman's Award

2013 FIRST Championship Curie Division | 2013 Wisconsin Regional Chairman's Award

2012 FIRST Championship Archimedes Division | 2012 Wisconsin Regional Engineering Inspiration Award, Woodie Flowers Finalist Award (Lead Mentor Ben Senson)

Reply With Quote
  #3   Spotlight this post!  
Unread 02-11-2013, 07:51 PM
y-aji y-aji is offline
Registered User
FRC #3734
 
Join Date: Dec 2011
Location: Lake Forest
Posts: 38
y-aji is an unknown quantity at this point
Re: Talon not responding

Sigh.. Someone plugged in the Talon backwards. Lol. I had to restart the whole robot after the Talon was plugged in correctly to get it to respond happily. The minute I turned it around, it worked fine.

If you query my username, I think every question I have asked has been answered this way for the past 3 years.. Haha..

Thank you!
Reply With Quote
Reply


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 07:51 AM.

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