#include #include "SSD1306.h" // alias for `#include "SSD1306Wire.h" // jfs Wemos lolin32 // jfs Heltec WiFi kit 32 (weisses Board) // #define HELTEC #define DEBUG // Initialize the OLED display using Wire library #ifdef HELTEC SSD1306 display(0x3c, 4, 15); #else SSD1306 display(0x3c, 5, 4); #endif #include "EasyPCF8574.h" EasyPCF8574 pcf_A(0x20,0); //PCF address, initial value //// WIFI const int mxSize=4; String ssids[mxSize] ={"GAST","pipanet","FRITZ!Box Gastzugang","WLAN-DE8245"}; String ssidp[mxSize] = {"passatvr6","passatvr6","praxis123","4955065570896956"}; boolean conok =false; void netfound(int i){ display.clear(); display.setColor(BLACK); display.fillRect(0, 0, 128, 10); display.setColor(WHITE); display.drawString(0,0,String(i)); display.drawString(20,0,"networks found"); display.display(); } boolean init_wifi(){ boolean ok = false; WiFi.mode(WIFI_STA); WiFi.disconnect(); delay(100); int n = WiFi.scanNetworks(); Serial.println("scan done"); if (n == 0) { Serial.println("no networks found"); netfound(0); } else { Serial.print(n); Serial.println(" networks found"); netfound(n); for (int i = 0; i < n; ++i) { for (int p=0;p> i) & 1) == 1 ? "1" : "0"); } Serial.println(); } void newFunc(int var) { for (unsigned int test = 0x8000; test; test >>= 1) { Serial.write(var & test ? '1' : '0'); } Serial.println(); } double ReadVoltage0dB(byte pin){ double reading = analogRead(pin); // Reference voltage is 3v3 so maximum reading is 3v3 = 4095 in range 0 to 4095 if(reading < 1 || reading > 4095) return 0; return reading*3.3/4095; } double ReadVoltage(byte pin){ double reading = analogRead(pin); // Reference voltage is 3v3 so maximum reading is 3v3 = 4095 in range 0 to 4095 if(reading < 1 || reading > 4095) return 0; // return -0.000000000009824 * pow(reading,3) + 0.000000016557283 * pow(reading,2) + 0.000854596860691 * reading + 0.065440348345433; return -0.000000000000016 * pow(reading,4) + 0.000000000118171 * pow(reading,3)- 0.000000301211691 * pow(reading,2)+ 0.001109019271794 * reading + 0.034143524634089; } // Added an improved polynomial, use either, comment out as required