Skip to content

Instantly share code, notes, and snippets.

@PeterJohnson
Created August 12, 2016 03:25
Show Gist options
  • Save PeterJohnson/92f1f2ae4a8a9dffd3df2c91cc563ffd to your computer and use it in GitHub Desktop.
Save PeterJohnson/92f1f2ae4a8a9dffd3df2c91cc563ffd to your computer and use it in GitHub Desktop.
import edu.wpi.first.wpilibj.AnalogInput;
import edu.wpi.first.wpilibj.AnalogOutput;
import edu.wpi.first.wpilibj.IterativeRobot;
@SuppressWarnings("all")
public class MyRobot extends IterativeRobot {
AnalogInput a0, a1, a2, a3;
AnalogOutput aout0;
public void robotInit() {
a0 = new AnalogInput(0);
a1 = new AnalogInput(1);
a2 = new AnalogInput(2);
a3 = new AnalogInput(3);
aout0 = new AnalogOutput(0);
System.out.println("voltage: " + a0.getVoltage());
aout0.setVoltage(0.5);
}
public void autonomousInit() {
}
public void autonomousPeriodic() {
}
public void teleopInit(){
}
public void teleopPeriodic() {
System.out.println(a0.getLSBWeight());
System.out.println(a1.getLSBWeight());
System.out.println(a2.getLSBWeight());
System.out.println(a3.getLSBWeight());
}
public void testPeriodic() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment