1 2 3 4 5 6 7 8 9 10 11 12 13
package org.usfirst.frc.team4272.robotlib; public class Toggler { private boolean prev = false; private boolean state = false; public boolean update(boolean next) { if (next && ! prev) { state = !state; } prev = next; return state; } }