// Settings.h1#ifndef SETTINGS_H2#define SETTINGS_H34// ---------------------- General settings ---------------------- //5// Change the part in brackets to your Duino-Coin username6extern char *DUCO_USER = "my_cool_username";7// Change the part in brackets to your mining key (if you have set it in the wallet)8extern char *MINER_KEY = "mySecretPass";9// Change the part in brackets if you want to set a custom miner name10// Use Auto to autogenerate, None for no custom identifier11extern char *RIG_IDENTIFIER = "None";12// Change the part in brackets to your WiFi name13extern const char SSID[] = "SSID";14// Change the part in brackets to your WiFi password15extern const char PASSWORD[] = "PASSW0RD";16// -------------------------------------------------------------- //1718// -------------------- Advanced options ------------------------ //19// Uncomment if you want to host the dashboard page (available on ESPs IP address and mDNS)20// #define WEB_DASHBOARD2122// Comment out the line below if you wish to disable LED blinking23#define LED_BLINKING2425// Uncomment if you want to use LAN8720. WLAN-credentials will be ignored using LAN26// Select correct Board in ArduinoIDE!!! Really!27// #define USE_LAN2829// Comment out the line below if you wish to disable Serial printing30#define SERIAL_PRINTING3132// Edit the line below if you wish to change the serial speed (low values may reduce performance but are less prone to interference)33#define SERIAL_BAUDRATE 5000003435// ESP8266 WDT loop watchdog. Do not edit this value, but if you must - do not set it too low or it will falsely trigger during mining!36#define LWD_TIMEOUT 300003738// Uncomment to disable ESP32 brownout detector if you're suffering from faulty insufficient power detection39// #define DISABLE_BROWNOUT4041// Uncomment to enable WiFiManager captive portal in AP mode42// The board will create its own network you connect to and change the settings43// REQUIRES WiFiManager library by tzapu (https://github.com/tzapu/WiFiManager)44// #define CAPTIVE_PORTAL45// -------------------------------------------------------------- //4647// ------------------------ Displays ---------------------------- //4849// Uncomment to enable a SSD1306 OLED screen on the I2C bus to display mining info in real time50// Default connections (can be overriden by using a different u8g2 initializer, see line 140):51// GND - GND52// VCC - 5V or 3.3V depending on display53// SCL - GPIO22 (ESP32) or GPIO5 (D2 on ESP8266) or GPIO35 (ESP32-S2)54// SDA - GPIO21 (ESP32) or GPIO4 (D1 on ESP8266) or GPIO33 (ESP32-S2)55// #define DISPLAY_SSD13065657// Uncomment to enable a 16x2 LCD screen on a direct bus to display mining info in real time58// See line 150 for connections and initializer59// #define DISPLAY_16X26061// Uncomment if your device is a Duino BlushyBox device62// #define BLUSHYBOX63// -------------------------------------------------------------- //6465// ---------------------- IoT examples -------------------------- //66// https://github.com/revoxhere/duino-coin/wiki/Duino's-take-on-the-Internet-of-Things6768// Uncomment the line below if you wish to use the internal temperature sensor (Duino IoT example)69// Only ESP32-S2, -S3, -H2, -C2, -C3, -C6 and some old models have one!70// More info: https://www.espboards.dev/blog/esp32-inbuilt-temperature-sensor/71// NOTE: Mining performance will decrease by about 20 kH/s!72// #define USE_INTERNAL_SENSOR7374// Uncomment the line below if you wish to use a DS18B20 temperature sensor (Duino IoT example)75// NOTE: Mining performance should stay the same76// #define USE_DS18B207778// Uncomment the line below if you wish to use a DHT11/22 temperature and humidity sensor (Duino IoT example)79// NOTE: Mining performance should stay the same80// #define USE_DHT8182// Uncomment the line below if you wish to use a HSU07M sensor (Duino IoT Example)83// NOTE: Untested as of right now84// #define USE_HSU07M85// -------------------------------------------------------------- //8687// ---------------- Variables and definitions ------------------- //88// You generally do not need to edit stuff below this line89// unless you're know what you're doing.9091#if defined(ESP8266)92// ESP826693#define LED_BUILTIN 294#elif defined(CONFIG_FREERTOS_UNICORE)95#if defined(CONFIG_IDF_TARGET_ESP32C3)96// ESP32-C397#define LED_BUILTIN 898#else99// ESP32-S2100#define LED_BUILTIN 15101#endif102#else103// ESP32104#ifndef LED_BUILTIN105#define LED_BUILTIN 2106#endif107#if defined(BLUSHYBOX)108#define LED_BUILTIN 4109#endif110#endif111112#define BLINK_SETUP_COMPLETE 2113#define BLINK_CLIENT_CONNECT 5114115#define SOFTWARE_VERSION "4.3"116extern unsigned int hashrate = 0;117extern unsigned int hashrate_core_two = 0;118extern unsigned int difficulty = 0;119extern unsigned long share_count = 0;120extern unsigned long accepted_share_count = 0;121extern String node_id = "";122extern String WALLET_ID = "";123extern unsigned int ping = 0;124125#if defined(USE_INTERNAL_SENSOR)126#include "driver/temp_sensor.h"127#endif128129#if defined(USE_DS18B20)130// Install OneWire and DallasTemperature libraries if you get an error131#include <OneWire.h>132#include <DallasTemperature.h>133// Change 12 to the pin you've connected your sensor to134const int DSPIN = 12;135136OneWire oneWire(DSPIN);137DallasTemperature extern sensors(&oneWire);138#endif139140#if defined(USE_DHT)141// Install "DHT sensor library" if you get an error142#include <DHT.h>143// Change 12 to the pin you've connected your sensor to144#define DHTPIN 12145// Set DHT11 or DHT22 type accordingly146#define DHTTYPE DHT11147148DHT extern dht(DHTPIN, DHTTYPE);149#endif150151#if defined(DISPLAY_SSD1306)152// Install "u8g2" if you get an error153#include <U8g2lib.h>154#include <Wire.h>155// Display definition from the U8G2 library. Edit if you use a different display156// For software I2C, use ..._F_SW_I2C and define the pins in the initializer157U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE);158#endif159160#if defined(DISPLAY_16X2)161#include "Wire.h"162// Install "Adafruit_LiquidCrystal" if you get an error163#include "Adafruit_LiquidCrystal.h"164165// initialize the library with the numbers of the interface pins166// RS E D4 D5 D6 D7167Adafruit_LiquidCrystal lcd(1, 2, 3, 4, 5, 6);168#endif169170#if defined(USE_HSU07M)171#include "Wire.h"172#define HSU07M_ADDRESS 0x4B // Change this if your sensor has a different address173174float read_hsu07m() {175Wire.beginTransmission(HSU07M_ADDRESS);176Wire.write(0x00);177Wire.endTransmission();178delay(100);179Wire.requestFrom(HSU07M_ADDRESS, 2);180if(Wire.available() >= 2) {181byte tempMSB = Wire.read();182byte tempLSB = Wire.read();183int tempRaw = (tempMSB << 8) | tempLSB;184float tempC = (tempRaw / 16.0) - 40.0;185return tempC;186}187return -1.0;188}189#endif190191#if defined(BLUSHYBOX)192#define GAUGE_PIN 5193#define GAUGE_MAX 190194#define GAUGE_MIN 0195#if defined(ESP8266)196#define GAUGE_MAX_HR 80000197#else198#define GAUGE_MAX_HR 200000199#endif200extern float hashrate_old = 0.0;201202void gauge_set(float hashrate) {203float old = hashrate_old;204float new_val = hashrate;205206if (hashrate_old == 0) {207float delta = (new_val - old) / 50;208for (int x=0; x < 50; x++) {209analogWrite(5, map(old + x*delta, 0, GAUGE_MAX_HR, GAUGE_MIN, GAUGE_MAX) + random(0, 10));210delay(20);211}212} else {213float delta = (new_val - old) / 10;214for (int x=0; x < 10; x++) {215analogWrite(5, map(old + x*delta, 0, GAUGE_MAX_HR, GAUGE_MIN, GAUGE_MAX) + random(0, 10));216delay(10);217}218}219hashrate_old = hashrate;220}221#endif222223IPAddress DNS_SERVER(1, 1, 1, 1); // Cloudflare DNS server224225#endif // End of SETTINGS_H226227228