All pastes #2046002 Raw Edit

lab1pseudocode

public c v1 · immutable
#2046002 ·published 2011-04-13 13:52 UTC
rendered paste body
while (1) {	if (button) {		while (button) { //when button is depressed, start timer 			timer++;			if (timer == 250) { var = 1; } //if sufficient time has passed, the button press is valid		}	}	if (var) {		if (!button) { //when button is released, count the press (if valid) and reset the valid indicator			pushcount++;			var = 0; 		}	}}