Blinking LED - how to implement it correctly?

Well, in general it’s not really “bad”. But it’s not great. We should endeavor to avoid writing rules that do nothing most of the time. This is also sometimes called polling. It’s much better to instead react to events and only do work when necessary instead of always doing something even when you don’t need to. The code tends to be simpler to understand and maintain and you avoid being wasteful with resources.

However, is it really bad to do this? No, not really. You’ll be spamming the logs, sure and that can add up to wearing out an SD card a little faster. And you’ll be using probably a barely measurable more amount of energy per day. But those are not really that bad of a problem.

So what is someone to do? You have a number of options actually. A couple are:

1 Like