I am working on an adaption of the code shown here, however, instead of using individual values I want to create an enum of possible values.
I would like to keep this in the header file if possible, and I would like it to include the values something like…
enum Notes{
NOTE_B0 = 31,
NOTE_C1 = 33,
NOTE_CS1 = 35
};
Now I am looking to iterate through the enum values, how would I do this?
Also can I store values over 255?
The best you can do is create a static const array of all the enum values somewhere and iterate through that. If the enum values were all consecutive you could obviously iterate through them easily enough, but short of that you’re out of luck.