using pullstime

I now can't upload the code to the Arduino.

That is not a problem with the code. Close down the IDE, unplug the Arduino then restart the IDE and plug the Arduino back in and check that the COM port that it is using is correct.