Ok, So I am working on a project that uses six DS18B20 temperature sensors. I am trying to incorporate a light into the program. I have all six temperature probes outputing their data to the blynk app with no issues, all six show up fine using the “value display” widget. But when I add a button widget and set it to D22 to turn on a LED on D22 it will not turn the LED on. But I can load the BlynkBlink sample program and it will turn the LED on D22 on… Im running this on an Arduino Mega 2560, and the app is on iPhone.
Here is the code I am running that works on everything but the light.
#define BLYNK_PRINT Serial
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
void setup()
{
sensors.begin();
Serial.begin(9600);
Blynk.begin(auth);
}
void loop()
{
Blynk.run();
sensors.requestTemperatures();
Blynk.virtualWrite(0, sensors.getTempFByIndex(0));
Blynk.virtualWrite(1, sensors.getTempFByIndex(1));
Blynk.virtualWrite(2, sensors.getTempFByIndex(2));
Blynk.virtualWrite(3, sensors.getTempFByIndex(3));
Blynk.virtualWrite(4, sensors.getTempFByIndex(4));
Blynk.virtualWrite(5, sensors.getTempFByIndex(5));
}
The code above will not turn on the LED But this code will, What is the conflict that I am having?
#define BLYNK_PRINT Serial
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
void setup()
{
Serial.begin(9600);
Blynk.begin(auth);
}
void loop()
{
Blynk.run();
}