Use bits inside an int.
Assigning the value will automatically set the bits, that can be tested and pushed to the optos.