summaryrefslogtreecommitdiff
path: root/src/org/usfirst/frc/team4272/robotlib/Toggler.java
blob: 03fffec349a904424723eb142fa434f1acd31b7c (plain)
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;
	}
}