Combine two Arduino projects into one PCB with the Arduino codes combined.

what I am saying is that I am using the first code as the base code and adding the tone part from the second code into the first code

Yes if you like.