Please Need Help to combine two codes

HazardsMind:

9V battery

Do you mean a regular store bought 9V? If so, dont bother, that battery will last you maybe 20 - 30 minutes of continious use, maybe. Unless you plan on getting 4 or 5 of them and putting them in parallel. Get a 9V rechargeable battery pack, like the ones used in Hobby RC cars. Those have a LOT of current, and can be reused.
Time wise, depends on the battery's mAh's.

thanks for your help