Sample Bang Bang code

Does anyone have a sample of bang bang code? I have tried to make my own and am having trouble getting it down.

A quick search on the forum will bring up a multitude of threads discussing bang bang and other velocity controls. I recommend searching the forum for answers because most of the time someone else has answered questions you may have. Here is one such thread: