4 ms·
It doesn't, I think. Active is whether or not the blinker is active; though I'd have expected a default for that. The blinker is itself switching on and off. Ma
by ghusbands 5y ago
It doesn't, I think. Active is whether or not the blinker is active; though I'd have expected a default for that. The blinker is itself switching on and off. Making it inactive would probably stop it doing that.
- magicalhippo 5y agoOk, now I'm properly confused. So #Blinker has some code not shown that actually does what the C-like code below does? I assumed active was to turn the GPIO high, given that the code was supposed to implement the same logic. edit: yeah ok I see it now: describe the actual relationship, make that explicit, and instead keep the procedural code that maintains it as a hidden implementation detail.
- mpweiher 5y agoExactly! :-) If it could be explained better, I am all ears!
- magicalhippo 5y agoIf the point was to hide the #Blinker implementation, then a simple code comment that #Blinker is implemented elsewhere would have probably helped me on my first pass. Not a huge deal though :)
- mpweiher 5y agoExactly correct. Having active elements activate immediately is a good choice for simple examples like the one shown. For larger constructions, you typically want to have built the whole thing before starting it up.