From 1a50d9b5cf8cdb4785d45919e6e9d56ca3cc89f5 Mon Sep 17 00:00:00 2001 From: Dooho Yi Date: Tue, 16 Feb 2021 13:43:04 +0900 Subject: [PATCH] taak update. --- taak/platformio.ini | 8 ++++++++ taak/src/main.cpp | 26 +++++++++++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/taak/platformio.ini b/taak/platformio.ini index 82bcb25..d3fc094 100644 --- a/taak/platformio.ini +++ b/taak/platformio.ini @@ -28,3 +28,11 @@ lib_deps = ${env.lib_deps} ESP8266WiFi Servo(esp8266) + +[env:d1_mini_pro] +platform = espressif8266 +board = d1_mini_pro +lib_deps = + ${env.lib_deps} + ESP8266WiFi +upload_speed = 460800 diff --git a/taak/src/main.cpp b/taak/src/main.cpp index 7d9bcd3..c3f2dd5 100644 --- a/taak/src/main.cpp +++ b/taak/src/main.cpp @@ -41,10 +41,20 @@ #define SET_CONTAINSROOT //==================== -//======================== -#include "taaks.h" -#define TAAK_KEY TAAK_E_KEY // A-E-I-O-U-W-Y-N (up to 8 taaks) - KEY 150 ~ 157 -//======================= +//======================== +#define TAAK_A_KEY 150 //solenoid +#define TAAK_E_KEY 151 //valve +#define TAAK_I_KEY 152 +#define TAAK_O_KEY 153 +#define TAAK_U_KEY 154 +#define TAAK_W_KEY 155 +#define TAAK_Y_KEY 156 +#define TAAK_N_KEY 157 +//======================= + +//======================== +#define ID_KEY TAAK_N_KEY +//======================= //======================== #define MESH_SSID "forest-all/around" @@ -65,6 +75,8 @@ // #if defined(ARDUINO_ESP8266_NODEMCU) // nodemcuv2 #define LED_PIN 2 +#elif defined(ARDUINO_ESP8266_WEMOS_D1MINIPRO) // d1_mini_pro +#define LED_PIN 2 #elif defined(ARDUINO_ESP8266_ESP12) // huzzah #define LED_PIN 2 #elif defined(ARDUINO_FEATHER_ESP32) // featheresp32 @@ -195,7 +207,7 @@ void receivedCallback(uint32_t from, String & msg) { // REQUIRED int gate = str_gate.toInt(); //is it for me, the gastank? - if (key == TAAK_KEY) { + if (key == ID_KEY) { //taak_on && taak_off if (velocity == 0) { if (gate == 1) { @@ -316,6 +328,10 @@ void setup() { // nodeId (hex) : 2D370A07 // MAC : B6, E6, 2D, 37, A, 7 + //introduction + Serial.print("my ID Key --> "); + Serial.println(ID_KEY); + //i2c master Wire.begin();