re-using code

How can I reuse the functions I have written?

I now do a cut and paste.

I a lib the only way? :confused:

I think so but not sure, so I'm joining the thread just see what the others say.

I a lib the only way?

Using library files will allow you to #include code from a central location but you can just have multiple tabs in the IDE and copy a whole .ino file containing useful functions into the sketch directory and it will be compiled along with the main .ino file. This does mean that you will have multiple copies of the same file so they can be tedious to update unlike the centrally located library files.

There are many pieces of code that I have written that I want to use in another program. Most times, however, I want to make some small tweaks and you can't do that if the code is in a library.

Or, another way of looking at it, I am not prepared to take the time to make a library version that is sufficiently universal not to need tweaking.

...R

Same here. No libraries, no classes. Just copy & paste & tweak as needed. Or recreate from scratch so I can remember how to do it again.

Create a cpp file with your functions. Add a h file with the prototypes. Copy those to the sketch directory where you need them.

It's a mix of UKHeliBob's ino solution and a library.