In my bang-bang controller, I used a task (specifically jankyTask, courtesy of Bob.Wolff in this thread:
http://www.chiefdelphi.com/forums/sh...ght=Tasks+in+C)
I setup the SetTargetRPM of our shooter, to use the RPM to compute a target_period, and in the task I read the period from the counter class, and compare it to the computed target period, if the period is above target set the motor to 100%, if the target is below I set 0%. I only call motor.Set if the motor command has changed from the previous run (since the set carries a good bit of overhead).
In addition, I've added some code akin to the take-back-half suggested by Ether. When we trigger our shot, I disable the bang-bang control and set a constant 50% power for a short time; this addition seemed to help our shot consistency, but it's a bit of a hack
Edit: I can provide source code if you like, but I didn't want to spoil the fun