change the port, actually it's not the code issue it was the issue between your port and Arduino board