• Arduino UNO with Serial USB: Proteus Simulation
• Smartphone OS: Android
• Blynk server
• Blynk Library version: Latest
#define BLYNK_PRINT SwSerial
#include <SoftwareSerial.h>
SoftwareSerial SwSerial(10, 11); // RX, TX
#include <BlynkSimpleStream.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "XXXXXXXXXXXXXXXz";
const int tempsensor_val = A0;
const int ldr_val = A1;
const int water_val = A2;
const int lamppin = 13;
const int heatpin = 12;
const int fanpin = 7;
const int shadingpin = 5;
const int pumppin = 6;
BlynkTimer timer;
// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void myTimerEventa()
{
int sensorData1 = analogRead(tempsensor_val);
float tempData = (sensorData1/1024.0)*5000/10;
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V5, tempData);
}
void myTimerEventb()
{
int ldrData = analogRead(ldr_val);
Blynk.virtualWrite(V6, ldrData);
}
void myTimerEventc()
{
int waterData = analogRead(water_val);
Blynk.virtualWrite(V7, waterData);
}
BLYNK_WRITE(V8)
{
int pinValue = param.asInt();
if(pinValue==1){
digitalWrite(heatpin, HIGH);
} else {
digitalWrite(heatpin, LOW);
}
// process received value
}
BLYNK_WRITE(V9)
{
int pinValue1 = param.asInt();
if(pinValue1==1){
digitalWrite(lamppin, HIGH);
} else {
digitalWrite(lamppin, LOW);
}
// process received value
}
BLYNK_WRITE(V10)
{
int pinValue2 = param.asInt();
if(pinValue2==1){
digitalWrite(pumppin, HIGH);
} else {
digitalWrite(pumppin, LOW);
}
// process received value
}
BLYNK_WRITE(V11)
{
int pinValue = param.asInt();
if(pinValue==1){
digitalWrite(fanpin, HIGH);
} else {
digitalWrite(fanpin, LOW);
}
// process received value
}
BLYNK_WRITE(V12)
{
int pinValue = param.asInt();
if(pinValue==1){
digitalWrite(shadingpin, HIGH);
} else {
digitalWrite(heatpin, LOW);
}
// process received value
}
void setup()
{
// Debug console
SwSerial.begin(9600);
pinMode(tempsensor_val, INPUT);
pinMode(ldr_val, INPUT);
pinMode(water_val, INPUT);
pinMode(lamppin, OUTPUT);
pinMode(heatpin, OUTPUT);
pinMode(fanpin, OUTPUT);
pinMode(pumppin, OUTPUT);
pinMode(shadingpin, OUTPUT);
// Blynk will work through Serial
// Do not read or write this serial manually in your sketch
Serial.begin(9600);
Blynk.begin(Serial, auth);
// Setup a function to be called every second
timer.setInterval(2000L, myTimerEventa);
timer.setInterval(2000L, myTimerEventb);
timer.setInterval(2000L, myTimerEventc);
}
void loop()
{
Blynk.run();
timer.run(); // Initiates BlynkTimer
}
So what I want to achieve is that when I will create an other button in the blynk app with virtual pin 13 and when the button is off only then will the other 5 blynk buttons , as described in the code, work. When virtual pin 13 is high, I want them to remain unresponsive…
is there any way, I can do this?
Edit: It’s possible push a virtual button and disable other button? - Need Help With My Project - Blynk Community Found this link