How to integrate Source Codes of multiple functions?

AIM OF MY GRADUATION PROJECT: To build an autonomous real time device to measure the physical and chemical parameters of water using Arduino(an open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software for the board.) Atmega 2560 Microcontroller.

HARDWARE TOOLS FOR MY PROJECT:
Arduino Atmega 2560 development board
4x4 Matrix Keypad
16x2 LCD
Series 2 Zigbee Pair
Physical & Chemical Water Parameters Sensors(Ph Sensor, Conductivity, Dissolved Oxygen, Temperature and level sensor)

I'm using ATMEGA 2560 Development Board. And working on a project that uses keypad, lcd, various sensors, Zigbee, etc.., How to integrate and write a long source code for LCD, ADC and Keypad or any other modules such as Sensors, Zigbee or so???

Individually, Im able to run program for LCD OR ADC

But My questions is how to write and generate a program for all interfaces I'm using. I'm facing a difficulty in writing an integrated program.

Could U please suggest me something that is helpful?

Thanks.

The usual way is to combine the pre-setup code in one section, with all #define or #include at the top;
the setup code into a section;
and the loop code into a section.
Functions remain seperate.
Go thru and take care of duplicate pins, duplicate variable names, duplicate pinModes, Serial.begins, etc., and review what's in loop to see if it does what you want.

Pretty simple really 8)

Ok Thank You!! :slight_smile:

I'm facing a difficulty in writing an integrated program.

Form functions for every related job like reading keypad and running LCD and then call them, this manages code plus you know where you are making the LCD work and where the ADC etc.