setup state for digital output, not tested!