You also want to make sure that you are using analog values and that neutral is at 127, meaning nothing is moving, the joysticks are in their normal position. 255 should be max (or at least near it), so going full speed forward. 0 should be your full speed reverse, make sure to calibrate your controller for that.
After that, you can use loops (like while, for, or switch) or conditionals like if, else statements.
Like:
if(pwm01 == 255)
full speed ahead;
of course that's pseudo code. At
www.ifirobotics.com you can find default code for the controller, that already defines all that for you, so you don't have to worry about doing all that.