Code in many pin control blocks generate different code depending on whether integer constants are given (instance of NumberBlocks) or other kinds of valid input (Variables, numberlists). Usually this just means setting pinMode once in Setup rather than using a special function.
Does anyone know why this is done?
It can create some odd bugs, which seem easy to fix but perhaps I just don’t understand why NumberBLock should be “special”?
eg.
Works and does something useful. If pin 5 is momentarily brought LOW an LED/resitor connected to it are powered on.
Code in many pin control blocks generate different code depending on whether integer constants are given (instance of NumberBlocks) or other kinds of valid input (Variables, numberlists). Usually this just means setting pinMode once in Setup rather than using a special function.
Does anyone know why this is done?
It can create some odd bugs, which seem easy to fix but perhaps I just don’t understand why NumberBLock should be “special”?
eg.
Works and does something useful. If pin 5 is momentarily brought LOW an LED/resitor connected to it are powered on.
It generates...
but
Does not work. It generates...