Go Down

Topic: Looking for a location for user-created headers (Read 1 time) previous topic - next topic

bitrex

Well, I've run into another problem now that I've got my problem with assigning pointers to elements of arrays straightened out.  I'm dealing with a couple of large arrays of numbers, and I was hoping to store them in a header file so they wouldn't clutter up the code, however when I put the header file in the sketch directory and do #include "arrays.h" the compiler can't find it.  Any ideas?

Groove

You would normally only put variables in a header if you were going to have them shared between several source files, and unless you're very careful with the declaration, you could end up with more than one instance of the variable.

I don't see how two arrays can clutter up code.
Keep it local - it avoids all kinds of potential hassle.

Per Arduino ad Astra

bitrex

Quote
I don't see how two arrays can clutter up code.


They're wavetables for direct digital synthesis - each array has 255 1 byte values, and I eventually will need 4 of them.  It's a lot of stuff to have sitting at the top of my sketch... :o

Groove

Quote
It's a lot of stuff to have sitting at the top of my sketch...


So, put them at the bottom of your sketch, with a forward extern reference at the top.   8-)
Per Arduino ad Astra

Kitep

You probably have them in the wrong directory.  Assuming you're Windows based, and the name of your library file is WaveTableArray.h

1) put the file in a folder named WaveTableArray
2) put this folder in arduino-0015\hardware\libraries\
 (or whereever your aduino files are)
  Note: this is NOT the directory in My Documents where you store the sketches)

Good luck!

Go Up