I want to merge two projects into one.

I am a beginner into Arduino trying out some stuff, Please help me out.

I have made two diff projects:
one is to control a set of four relays using an IR Remote (in my case a TV remote)
second one is to control the relays using a Telegram bot.
Both of the projects work well individually, But I want to combine it into a single project so that I can control the relays using both IR Remote and Telegram Bot.

I have tried to combine them, but wasn’t successful.
I ran into a number of problems like it was very slow to respond, or would throw out multiple errors etc.

I have attached the two programs below:

You can contact me through Telegram @arunkumarrr_m

IR_Control.ino (1.42 KB)

Telegram_bot.ino (6.06 KB)

This Simple Merge Demo may help.

Before trying to merge the programs go through each of them carefully to make sure they are not trying to use the same resource - for example an I/O pin. If you find conflicts change something in one of the separate programs and make sure it still works as a separate program with the change.

...R

If you want help getting a merged program to work you need to post your best attempt at the merged program and explain the problems. Then we'll have something to start from.

It's not very likely that anyone will want to just do all the work for you.

Steve