Need help fixing code please

In general combining 2 sketches require knowledge of how each sketch works and often involves restructuring to avoid hardware, timing, and/or resource conflicts.