my motor doesnt change direction

@kullah, the max value for a byte is 255. If you need a bigger value use an int

...R