BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

How can I correctly use loop cycle using Blynk?

Hello, everybody! Here is a situation: Blynk docs says that I have to ceep clean a loop cycle as far as I can. Ok, I have a sensor, that generate suddenly some digital signal in very short time delta. I know, that there is a BlynkTimer, that I can configure to check if there any signals.
The question is: do I need to configure BlynkTimer on some 100ms interval, or check this value on loop cycle?
Thanks.

It depends on the type of sensor, it if it’s a digital signal then you could look at using interrupts.
However, if it’s a sensor that sends data via a serial interface then it’s not so easy.

Pete.

1 Like

Thanks for advice, will look for interrupts! There is a nice example in library: Sync->ButtonInterrupt.

I actually don’t like the Blynk interrupt example in sketch builder.
This explains why:

Pete.

1 Like

Try answer this for me: I need to replace a spark-plug (I think) in my cars engine. The car is (mostly) blue and has 4 tires. How to proceed?

Get the hint? :stuck_out_tongue:

On this rare occasion I might have to correct you Pete! :grin::thinking:

While pampering my first born I found out that my UNO has a serial buffer!! :smiley: :candle: Trial and error made me abandon interrupts since it didn’t work well with Blynk. As long it’s “real” data and not a boolean value your’e getting, a semi-fast timer might do the trick!

But it all depends on what kinda car you drive :wink:

1 Like