After running this, it told me it is not able to connect the wifi. Why this happen?
void Fan_on() {
digitalWrite(8, HIGH); // Set digital pin 8 HIGH
}
void Fan_off() {
digitalWrite(8, LOW); // Set digital pin 8 LOW
}
BLYNK_WRITE(V0) // Executes when the value of virtual pin 0 changes
{
int fan;
fan = param.asInt();
broadcast1(fan);
}
void broadcast1(int &fan0)
{
if (fan0 == 1)
{
// execute this code if the switch widget is now ON
Fan_on();
}
else if (fan0 == 0)
{
// execute this code if the switch widget is now OFF
Fan_off();
}
}
I know I can use another way to write it on below method, but I do need to write like this as I need to put it in mBlock. Thank you.
BLYNK_WRITE(V0) // Executes when the value of virtual pin 0 changes
{
if (param.asInt() = 1)
{
Fan_on();
}
else if ((param.asInt() = 0)
{
Fan_off();
}