I am moving things to the new platform and all of a sudden am having the most basic of issues. I’ve paired this code down to almost nothing and it’s not working. All I am trying to do is print output to serial monitor when Virtual Button V6 is pressed (ESP8266 D1 mini). Help me see the obvious?
*************************************************************
Most Basic VPIN example possible
*************************************************************/
// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID ""
#define BLYNK_DEVICE_NAME ""
#define BLYNK_AUTH_TOKEN ""
// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <E131.h>
#define VPIN_BUTTON_6 V6
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "";
char pass[] = "";
bool Up = false;
bool Down = false;
BlynkTimer timer;
//const int universe = 21; // this sets the universe number you are using.
// This function is called every time the Virtual Pin 6 state changes
BLYNK_WRITE(V6)
{
// Set incoming value from pin V6 to a variable
int value = param.asInt();
// Update state
Blynk.virtualWrite(V6, value);
Down = param.asInt();
Serial.println("V6");
}
void setup()
{
// Debug console
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
}
void loop()
{
Blynk.run();
if (Down){ // if condition
Serial.println("Going Down");
}
}
You might have pared you code down, but there’s still a lot of redundant stuff in there,
First of all, you need to define what “Not Working” means from your point of view.
Is the device connecting to Blynk?
Are you seeing any serial output?
Is that serial output changing at all when you press the widget button attached to datastream V6?
I have some questions though…
how is your V6 datastream configured?
How is your button wiudget attached to pin V6 configured? (Push, Switch)
Thanks Pete. Nothing is being output at all to the monitor. After the hard reset I get nothing, and nothing on button press. What can I add to see if it’s connecting to Blynk? would that be putting Blynk.begin(auth, ssid, pass); in an if statement?
As far as the datastream it’s just configured for PIN v6, datatype int
The button is a switch type (although I did try Push type as well) tied to datastream above
The Blynk.virtualWrite(V6, value); was me trying to force anything at all to happen
Wow, thanks Pete. You helped me indirectly here and I thank you. So I had also upgraded to the new Arduino IDE and didn’t realize the Serial Monitor and Output were on dif tabs (used to the serial monitor being in it’s own window). I was looking in the wrong place for the monitor. (bangs head). Thank you, it works now (and I removed the useless write).