I’m still having the same problem, but I am compiling on a Mega using BlynkSimpleEthernet2
I can get a simple version working, but when trying to integrate into my home IOT server, I get this error. The code is simply too large to paste here.
Seems like an issue with the Arduino IDE and templates. Just a guess.
This ADC_MODE(ADC_VCC); is an ESP command, not an Arduino one… in your case you are using the ESP in AT mode which means it is just a simple adapter now and not command accessible as it would be in standalone mode.
@ClintonK I’d start a new thread and post your code (correctly formatted) and the error messages you’re getting, along with details of what version of the IDE, Blynk libraries etc that you’re using.
I’ve moved over to a Zero so I don’t take down my server. This code replicates the problem seen on different platforms and produces the compile errors below (code follows). Moving the macro below the #include <BlynkSimpleEthernet2.h>
solves the problem, but that’s a band-aid. On larger projects this can cause problems if multiple libraries start having precedence requirements.
Macro_fail:29: error: variable or field 'BlynkWidgetWrite8' declared void
BLYNK_WRITE(V8){
^
Macro_fail:29: error: 'BlynkReq' was not declared in this scope
BLYNK_WRITE(V8){
^
Macro_fail:29: error: expected primary-expression before 'const'
BLYNK_WRITE(V8){
^
exit status 1
variable or field 'BlynkWidgetWrite8' declared void
--
The example code
#define RANDOM_MACRO(mode) int empty_function(void) { return (int) (mode); }
#include <SPI.h>
#include <Ethernet2.h>
RANDOM_MACRO(5); // CAUSES COMPILE ERROR IF IT'S HERE
#include <BlynkSimpleEthernet2.h>
// RANDOM_MACRO(5); // COMPILES IF ITS AFTER #include <BlynkSimpleEthernet2.h>
IPAddress ip(192,168,222, 120 );
const char auth[] = "authorization code";
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
static IPAddress myDns(8,8,8,8);
IPAddress subnet_mask(255, 255, 255, 0);
void setup() {
Blynk.begin(auth, "blynk-cloud.com", 8442, ip, myDns, mac);
}
void loop() {
Blynk.run();
}
BLYNK_WRITE(V8){
int pinValue = param.asInt(); // assigning incoming value from pin V2 to a variable
Serial.print("V* button value is: ");
Serial.println(pinValue);
}