Breaking up code in multiple files
Posted: Thu Nov 23, 2023 5:22 am
I've been trying to program a teensy 4.1. When i smash everything into the main .ino file, i have no problems.
When i try to use pointers or move any reference outside of the main file i run into serious problems.
First is passing a function into the command handler. It seems like the only way to do this is by defining it in the main ino. is that correct?
Second, say i want another class to run some procedure, update a value, then send the updated value to megulink. If that code is defined in another file, i have to pass a reference into the object. If i turn mypanel into a pointer, everything breaks.
If anyone has any tips/thoughts, i'd appreciate it.
Blake
When i try to use pointers or move any reference outside of the main file i run into serious problems.
First is passing a function into the command handler. It seems like the only way to do this is by defining it in the main ino. is that correct?
Second, say i want another class to run some procedure, update a value, then send the updated value to megulink. If that code is defined in another file, i have to pass a reference into the object. If i turn mypanel into a pointer, everything breaks.
If anyone has any tips/thoughts, i'd appreciate it.
Blake