Good, I need help with a problem using Blynk.edge. (Blynk iot Pro with the latest updated version, I use ESP 32, Arduino IDE 1.8.16. Here’s the situation: I use several ds18b20 sensors connected parasites to pin 16 of esp 32, measuring the temperature and sending it to several virtual pins on Blink IOT .
My problem is to associate by code, each sensor separately by the hexadecimal code that I have already identified to a virtual pin of blyn iot.
The code that I will put below is an example that I use, but the sensors enter without identification, that is, when one takes the place of the other, for a connected sensor it works, but when you place many sensors I have many problems.
Anyone who can help would be greatly appreciated!
example associate these addresses to virtual pins , by blynk.edge
Printing Address
Sensor 1: 0x28, 0x5E, 0x7C, 0x07, 0xB6, 0x01, 0x3C, 0x5D
Sensor 2: 0x28, 0xAA, 0x1B, 0x22, 0x50, 0x14, 0x01, 0x04
Sensor 3: 0x28, 0xAA, 0xD1, 0x22, 0x50, 0x14, 0x01, 0x9B
#define BLYNK_TEMPLATE_ID " xxxxxxxx"
#define BLYNK_TEMPLATE_NAME "xxxxxxxxx"
#define BLYNK_FIRMWARE_VERSION "0.1.0"
#define BLYNK_PRINT Serial
#define APP_DEBUG
#include "BlynkEdgent.h"
#include <DallasTemperature.h>
#include <OneWire.h>
const int oneWireBus = 16;
OneWire oneWire(oneWireBus);
DallasTemperature sensors(&oneWire);
BlynkTimer timer;
void getTemperature()
{
sensors.requestTemperatures();
float temperatureA = sensors.getTempCByIndex(0);
float temperatureB = sensors.getTempCByIndex(1);
float temperatureC = sensors.getTempCByIndex(2);
Blynk.virtualWrite(V11, temperatureA);
Blynk.virtualWrite(V12, temperatureB);
Blynk.virtualWrite(V13, temperatureC);
}
void setup()
{
Serial.begin(115200);
BlynkEdgent.begin();
timer.setInterval(1000L, getTemperature);
void loop()
{
BlynkEdgent.run();
timer.run();
}