Weird arduino behaviour

write... does not set the pin mode!