Combining two separate codes issues

if one is HIGH and the other is LOW?

write pin 12 HIGH or LOW? Which ONE!

clear your loop first :wink:

void loop()
{
 Blynk.run(); 
 timer.run();
}

Pin 12 goes HIGH ! I’m not bothered about logic !
Thanks anyways sir .
Second code is creating all the trouble

No problem. Good Luck.

Blynk only suggests to keep away the codes regarding the retrieval of some data from these void loop .
That code inside void loop controls the switching of relay like normally ! It doesn’t send us any data

@Gunner hey man ! Plz help

@PeteKnight sir , is there any possibility of bringing Blynktimer timer1 and Blynktimer timer 2 and putting timer1.run and timer2.run ?

the dog will be angry.
but do as you like :joy::joy:
that makes no sense to read and write every milliseconds.

2 Likes

Don’t do that. You can have up to 16 separate timer instanced for each timer object, so it’s not necessary.

It’s already been pointed out that these two software serials, on the same pins, won’t work.

The advice about cleaning up your void loop is very good advice, take heed of it!

Pete.

1 Like

Missed this the first time around:

uint32_t start_time = millis();
while((millis()-start_time) < 3000)
  1. Change uint32_t to > unsigned long
  2. Change 3000 to > 300 (as @Toro_Blanco mentioned, as soon as this has time to execute the timer will be called again starting from the beginning)

Let us know what you get in serial monitor too.