Trouble with globals? (board: huzzah)

I have a header file that includes a typedef for a configuration struct:

typedef struct {
        char idPrefix[8];
        char defPass[16];
        char targetSSID[32];
        char targetPass[64];
        uint8_t beepInRange;
        uint8_t beepOutofRange;
} devConfig;

I want to assign a config variable in my ino file:

devConfig myConfig;

but when i try to access it in my setup or loop, it say ‘not defined in this scope’. e.g.:

void setup() {
strncpy(myConfig.defPass, “somepass”, 16);

spits out the “error: ‘myConfig’ was not declared in this scope” when I try to platform run

Does this thing not support global variables in the same way as arduino?

Just rename from INO to CPP and forget about all troubles. Maybe this info will be helpful

I’m not having a problem with the source being recognized. It wouldn’t be producing any errors if it wasn’t finding the INO file. The problem is that something I’m setting in (what would normally be global scope on the Arduino IDE) isn’t being seen inside a function on the platformio

Do you have any issues after renaming from INO to CPP?

========================= [SUCCESS] Took 52.95 seconds =========================

woo hoo

1 Like

How did you fix that?

#include <Arduino.h>