taak update.
This commit is contained in:
parent
8fa1ee7f54
commit
1a50d9b5cf
2 changed files with 29 additions and 5 deletions
|
|
@ -28,3 +28,11 @@ lib_deps =
|
||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
ESP8266WiFi
|
ESP8266WiFi
|
||||||
Servo(esp8266)
|
Servo(esp8266)
|
||||||
|
|
||||||
|
[env:d1_mini_pro]
|
||||||
|
platform = espressif8266
|
||||||
|
board = d1_mini_pro
|
||||||
|
lib_deps =
|
||||||
|
${env.lib_deps}
|
||||||
|
ESP8266WiFi
|
||||||
|
upload_speed = 460800
|
||||||
|
|
|
||||||
|
|
@ -41,10 +41,20 @@
|
||||||
#define SET_CONTAINSROOT
|
#define SET_CONTAINSROOT
|
||||||
//==========</preset>==========
|
//==========</preset>==========
|
||||||
|
|
||||||
//============<this taak>============
|
//============<list of reserved keys>============
|
||||||
#include "taaks.h"
|
#define TAAK_A_KEY 150 //solenoid
|
||||||
#define TAAK_KEY TAAK_E_KEY // A-E-I-O-U-W-Y-N (up to 8 taaks) - KEY 150 ~ 157
|
#define TAAK_E_KEY 151 //valve
|
||||||
//============</this taak>===========
|
#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
|
||||||
|
//============</list of reserved keys>===========
|
||||||
|
|
||||||
|
//============<identity key>============
|
||||||
|
#define ID_KEY TAAK_N_KEY
|
||||||
|
//============</identity key>===========
|
||||||
|
|
||||||
//============<parameters>============
|
//============<parameters>============
|
||||||
#define MESH_SSID "forest-all/around"
|
#define MESH_SSID "forest-all/around"
|
||||||
|
|
@ -65,6 +75,8 @@
|
||||||
//
|
//
|
||||||
#if defined(ARDUINO_ESP8266_NODEMCU) // nodemcuv2
|
#if defined(ARDUINO_ESP8266_NODEMCU) // nodemcuv2
|
||||||
#define LED_PIN 2
|
#define LED_PIN 2
|
||||||
|
#elif defined(ARDUINO_ESP8266_WEMOS_D1MINIPRO) // d1_mini_pro
|
||||||
|
#define LED_PIN 2
|
||||||
#elif defined(ARDUINO_ESP8266_ESP12) // huzzah
|
#elif defined(ARDUINO_ESP8266_ESP12) // huzzah
|
||||||
#define LED_PIN 2
|
#define LED_PIN 2
|
||||||
#elif defined(ARDUINO_FEATHER_ESP32) // featheresp32
|
#elif defined(ARDUINO_FEATHER_ESP32) // featheresp32
|
||||||
|
|
@ -195,7 +207,7 @@ void receivedCallback(uint32_t from, String & msg) { // REQUIRED
|
||||||
int gate = str_gate.toInt();
|
int gate = str_gate.toInt();
|
||||||
|
|
||||||
//is it for me, the gastank?
|
//is it for me, the gastank?
|
||||||
if (key == TAAK_KEY) {
|
if (key == ID_KEY) {
|
||||||
//taak_on && taak_off
|
//taak_on && taak_off
|
||||||
if (velocity == 0) {
|
if (velocity == 0) {
|
||||||
if (gate == 1) {
|
if (gate == 1) {
|
||||||
|
|
@ -316,6 +328,10 @@ void setup() {
|
||||||
// nodeId (hex) : 2D370A07
|
// nodeId (hex) : 2D370A07
|
||||||
// MAC : B6, E6, 2D, 37, A, 7
|
// MAC : B6, E6, 2D, 37, A, 7
|
||||||
|
|
||||||
|
//introduction
|
||||||
|
Serial.print("my ID Key --> ");
|
||||||
|
Serial.println(ID_KEY);
|
||||||
|
|
||||||
//i2c master
|
//i2c master
|
||||||
Wire.begin();
|
Wire.begin();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue