Changing the digital ports voltage?

It still can be used here, just not the way you did

OK so how would use it in this case and how would the result be different?