added esp32 postman category.

This commit is contained in:
Dooho Yi 2019-12-15 06:01:17 +09:00
parent f709b3250d
commit 3ca0f4950b
4 changed files with 19 additions and 6 deletions

View file

@ -37,14 +37,14 @@ lib_deps =
[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
lib_deps =
lib_deps +=
ESP8266WiFi
Servo(esp8266)
[env:huzzah]
platform = espressif8266
board = huzzah
lib_deps =
lib_deps +=
ESP8266WiFi
Servo(esp8266)
@ -53,5 +53,13 @@ build_unflags = -std=gnu++11
build_flags = -std=gnu++14 ; AsyncTCP wants this.
platform = espressif32
board = featheresp32
lib_deps =
lib_deps +=
1826@1.0.3 ; AsyncTCP
[env:nodemcu-32s]
build_unflags = -std=gnu++11
build_flags = -std=gnu++14 ; AsyncTCP wants this.
platform = espressif32
board = nodemcu-32s
lib_deps +=
1826@1.0.3 ; AsyncTCP

View file

@ -11,7 +11,7 @@
[platformio]
env_default = featheresp32
[common]
[env]
framework = arduino
lib_deps =
SPI
@ -24,12 +24,10 @@ build_unflags = -std=gnu++11
build_flags = -std=gnu++14 ; AsyncTCP wants this.
platform = espressif32
board = featheresp32
framework = ${common.framework}
upload_speed = 921600
upload_port = /dev/ttyUSB0
lib_deps =
1826@1.0.3 ; AsyncTCP
${common.lib_deps}
13 ; Adafruit GFX Library
22 ; Adafruit HX8357 Library
377 ; Adafruit STMPE610

View file

@ -54,6 +54,7 @@ void register_nodes(){
registered[0xC21474D2] = NTYPE_POSTMAN;
registered[0xABB3B4B8] = NTYPE_POSTMAN;
registered[0x2D370A07] = NTYPE_POSTMAN;
registered[0xBFFBDD7D] = NTYPE_POSTMAN;
}
//============</registered-nodelist>===========

View file

@ -105,6 +105,8 @@
#define LED_PIN 2
#elif defined(ARDUINO_FEATHER_ESP32) // featheresp32
#define LED_PIN 13
#elif defined(ARDUINO_NodeMCU_32S) // nodemcu-32s
#define LED_PIN 2
#endif
#define LED_PERIOD (1111)
#define LED_ONTIME (1)
@ -272,7 +274,11 @@ void receivedCallback(uint32_t from, String & msg) { // REQUIRED
msg = msg.substring(0, POST_LENGTH); // (0) ~ (POST_LENGTH-1)
// send whatever letter we postmans trust other postman.
Wire.beginTransmission(I2C_ADDR);
#if defined(ARDUINO_NodeMCU_32S)
Wire.write((const uint8_t*)msg.c_str(), POST_LENGTH);
#else
Wire.write(msg.c_str(), POST_LENGTH);
#endif
Wire.endTransmission();
}
void changedConnectionCallback() {