combining 3 codes

Hi,

Combining Arduino Sketches
This is often difficult. Here is an approach that may help you be successful:

http://arduino-info.wikispaces.com/CombiningArduinoSketches