Hoping to get some help with what most will think is really simple , ive been using Blynk Legacy for years and have quite a lot of devices set up in the house all just relay switching for lifgts etc.
So now with the Blynk IoT its not just a matter of connecting the board and adding widgets with my phone and I need to add virtual pins to switch the outputs.
Using an Arduino Uno ethernet board ,Ive set up a template ,added a device and a data stream using V1 to switch gpio #2 and that works great. So now I cant seem to get the code correct for using multiple relays with vitual pins . Seems there are a lot of different ways to maybe do it and have multiple relays working with virtual pins on my Cayenne dashboard , but the coding process is somehow different.
Im guessing there will be alot of Legacy users who are enjoying the reliable simplicty Legacy provides and will probaly be looking for the similar solutions , I know the many people ive hepled setting up systems in their homes will be expecting me to upgrade thiers.
Any help would be much appreciated.
Dave.
#define BLYNK_DEVICE_NAME "XXXXXX"
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxx"";
#define W5100_CS 10
#define SDCARD_CS 4
BLYNK_WRITE(V1)
{
int pinValue = param.asInt( );
digitalWrite(2,pinValue);
}
void setup()
{
pinMode(2,OUTPUT);
// Debug console
Serial.begin(9600);
pinMode(SDCARD_CS, OUTPUT);
digitalWrite(SDCARD_CS, HIGH); // Deselect the SD card
Blynk.begin(auth);
// You can also specify server:
//Blynk.begin(auth, "blynk-cloud.com", 80);
//Blynk.begin(auth, IPAddress(192,168,1,100), 8080);
// For more options, see Boards_Ethernet/Arduino_Ethernet_Manual example
}
void loop()
{
Blynk.run();
}cpp
void loop()