Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
vshymanskyy committed Sep 4, 2023
1 parent 913f5a0 commit 5cf40d2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#error "Please specify your BLYNK_TEMPLATE_ID and BLYNK_TEMPLATE_NAME"
#endif

#define BLYNK_FIRMWARE_BUILD_TIME __DATE__ " " __TIME__

/*
* Implement the UART interface
*/
Expand All @@ -21,6 +23,12 @@
SoftwareSerial Serial1(10, 9);
#endif

#if defined(__AVR__)
#define BLYNK_NCP_BAUD 57600
#else
#define BLYNK_NCP_BAUD 230400
#endif

#if defined(BLYNK_NCP_SERIAL)
#define SerialNCP BLYNK_NCP_SERIAL
#elif defined(ARDUINO_NANO_RP2040_CONNECT)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
/* === CONFIGURATION ============= */
/*
* NOTE: This is a low level example of how to use BlynkNcpDriver directy.
*
* The Blynk C++ library ships with a simplified example,
* that works with a set of popular dual-MCU boards out of the box:
*
* https://bit.ly/EdgentNCP
*/

/* === BLYNK.NCP CONFIGURATION === */

/* Fill in information from your Blynk Template here */
/* Read more: https://bit.ly/BlynkInject */
//#define BLYNK_TEMPLATE_ID "TMPxxxxxx"
//#define BLYNK_TEMPLATE_NAME "Device"

#define BLYNK_FIRMWARE_VERSION "0.1.0"
#define BLYNK_FIRMWARE_BUILD_TIME __DATE__ " " __TIME__

#define SerialDbg Serial
//#define SerialNCP Serial1
// Define NCP connection port settings, if needed
//#define BLYNK_NCP_SERIAL Serial1
//#define BLYNK_NCP_BAUD 115200

/* =============================== */

#include "NCP_Helpers.h"
#define SerialDbg Serial

#include "ArduinoUtils.h"

void setup()
{
Expand Down Expand Up @@ -52,7 +63,7 @@ void setup()
// Set config mode timeout to 30 minutes, for testing purposes
rpc_blynk_setConfigTimeout(30*60);

// Provide MCU firmware info.
// Provide MCU firmware info to the NCP
// This info is mainly used for the Primary MCU OTA updates
rpc_blynk_setFirmwareInfo(BLYNK_FIRMWARE_TYPE,
BLYNK_FIRMWARE_VERSION,
Expand Down

0 comments on commit 5cf40d2

Please sign in to comment.