helper functions void motorUp(void) set direction pin set PWM speed end void motorDown() set direction pin set PWM speed using difficulty level end void motorDownFast() set direction pin set PWM speed using difficulty level end void initMCports() set servo pin set PWMS library init set AD pins set i/o for T & M ports end unsigned char setDifficulty() read A0 if val is within range 1 return x if val is within range 2 return y if val is within range 3 return z end void displayEnd(boolean Win) if Win = true set LED pins else turn off lights wait turn off all lights end