Show your updated code 2) Do not use pins 0 and 1 for anything else if you use it for serial communication.