Quote:
Originally Posted by Arhowk
Code:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package edu.wpi.first.wpilibj.templates.buttons;
import edu.wpi.first.wpilibj.buttons.Trigger;
import edu.wpi.first.wpilibj.command.Command;
/**
*
* @author Arhowk
*/
public class t1684_SD_TakeImage extends Trigger{
public boolean get(){return true;}
public void whenActive(Command command){
System.out.println("meh");
}
public void whileActive(Command command){
System.out.println("meh2");
}
public void whenInactive(Command command){
System.out.println("meh3");
}
}
this displays the button on the dash but wont do anything when clicked...
still getting above error
|
That's not how you use it.
Code:
Trigger doThingyTrigger;
doThingyTrigger.whenActive(new DoThingy()); // DoThingy is some class extending Command
SmartDashboard.putData("Do Thingy",trigger);
I'd put this in robotInit, but it can be almost anywhere.