beacon.h should be as follows:
typedef enum State{
from
#include <beacon.h> State state; // <-- the actual instance void setup() { state = menu; } void loop() { state = val_edit; }
Leave the typdef file and the final instance of "state" is turned off when you run it in the main INO file or vice versa. Where the above beacon.h file should be in the users. \ Arduino \ libraries \ beacon \ directory directory, and the IDE needs to be restarted to cache its location.
But you could just define it and specify everything at once in INO
enum State{ menu, output_on, val_edit } state;
Both compile fine.
You can also use the following:
typedef enum State{
here the instance is separate from the enumeration, allowing the enumeration to be exclusively a type. Where above is an instance, not a typedef.
mpflaga
source share