Browse Source

Fix libraries

esp32
ptrinchini 2 weeks ago
parent
commit
b779613fc0
  1. 17
      .vscode/extensions.json
  2. 7
      platformio.ini
  3. 14
      src/main.cpp

17
.vscode/extensions.json

@ -1,7 +1,10 @@
{ {
// See http://go.microsoft.com/fwlink/?LinkId=827846 // See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format // for the documentation about the extensions.json format
"recommendations": [ "recommendations": [
"platformio.platformio-ide" "platformio.platformio-ide"
] ],
} "unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}

7
platformio.ini

@ -8,9 +8,10 @@
; Please visit documentation for the other options and examples ; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html ; https://docs.platformio.org/page/projectconf.html
[env:nodemcuv2]
platform = espressif8266 [env:esp32dev]
board = nodemcuv2 platform = espressif32
board = esp32dev
framework = arduino framework = arduino
upload_protocol = esptool upload_protocol = esptool
lib_deps = lib_deps =

14
src/main.cpp

@ -1,13 +1,15 @@
#include <Arduino.h> #include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h> #include <WiFi.h>
#include <WebServer.h>
#include <PubSubClient.h> #include <PubSubClient.h>
#define WLAN_SSID "TP-LINK-RPT0" #define WLAN_SSID "TP-LINK-HOME"
#define WLAN_PASS "6JM54UG4EY" #define WLAN_PASS "6JM54UG4EX"
#define MQTT_CLID "ValveControl" #define MQTT_CLID "ValveControl"
#define MQTT_HOST "192.168.1.133" #define MQTT_HOST "192.168.1.146"
#define MQTT_PORT 1883 #define MQTT_PORT 1883
#define MQTT_USER "admin" #define MQTT_USER "admin"
#define MQTT_PASS "22pa0799" #define MQTT_PASS "22pa0799"
@ -33,7 +35,7 @@ int MotorPin1 = 0;
int MotorPin2 = 2; int MotorPin2 = 2;
int duration = 10000; int duration = 10000;
ESP8266WebServer server(80); WebServer server(80);
WiFiClient espClient; WiFiClient espClient;
PubSubClient client(espClient); PubSubClient client(espClient);

Loading…
Cancel
Save