High voltage drop on Nano outputs caused by sketch

It clearly says that multiple outputs have to be LOW for a varying resistor voltage. Fix your code.