Skip to main content
2 of 2
added 312 characters in body
Majenko
  • 105.9k
  • 5
  • 82
  • 139

Sure you can use a config file. It's called a "header" file, and you just #include it in your sketch.

[config.h (not pushed)]

const char *password = "DOD982yp398fhgpwbn09tupf0p04";

[sketch.ino (pushed)]

#include "config.h"

// Now you can use the password variable.

Another method, which is better if you have multiple files in your sketch, is to use #define instead of variables in your header file:

[config.h]

#define WIFI_PASSWORD "348r0yp80ytwp85tpj8yjp98y97t8t"

[sketch.ino]

#include "config.h"

const char *password = WIFI_PASSWORD;
Majenko
  • 105.9k
  • 5
  • 82
  • 139