Arduino behaves non-deterministic?