Help Combining Sketches

Hello,
I need some help combining some sketches. I did some googling and had a few goes at combining them without success. I’ve attached the codes below.

If anyone can help I will be very grateful.

TVB.ino (14.4 KB)

main.h (1.2 KB)

WORLDcodes.cpp (135 KB)

Fade.ino (953 Bytes)

toneMelody.ino (1.06 KB)

pitches.h (1.96 KB)

Hi, Can you tell us what each code does and if it compiles and works. What model arduino are you programming. Are you using any shields? What do you want to final combined sketch to do?

Tom..... :)

TomGeorge: Hi, Can you tell us what each code does and if it compiles and works. What model arduino are you programming. Are you using any shields? What do you want to final combined sketch to do?

Tom..... :)

Ok

The TVB code is the code for a TV-B-Gone, which turns on almost any TV. It uses the main.h and WORLDcodes.cpp

Fade is just the fade in examples, it increases the brightness of an led slowly and then decreases the brightness at the same rate.

The toneMelody is a modified version of the example and just plays a constant buzzing through a speaker.

All of the codes verify and work and I'm using an Arduino Pro Mini without any shields.

I want the final code to Fade a LED and play the sound From the toneMelody sketch and run the TV-B-Gone code when the board powers on

Have a look at this simple merge demo.

It was intended for a pair of .ino files and not the structure you have. However the idea of putting the code into functions should still be appropriate. Then just include all the .cpp and .h files

After that you will need to go through the code to check, for example, if two things are using the same pin for different purposes.

...R