Must I specify SPI pins as hardwired pins numbers?
tomcrawford
Posts: 1,126
When I use a shift out operator, can I not use a variable to specify the pin number?
If not, why not? I always thought that naming pin numbers is good programming practice.
If not, why not? I always thought that naming pin numbers is good programming practice.
Comments
Depends what you mean.
In any language, it is usual/desirable to have a common defined name, that is used many times elsewhere in code.
Mostly, those are actually constants, in that the compilers evaluate and replace at compile time.
A true variable, allows a run time change, and that is slower, and requires more code.
We are making two improvements to this system for the next release. All blocks appropriate for this addition will have the "other" option and we will also implement the constant definition so it does not use RAM.
So, it's coming!
Ken Gracey
Thanks!
Matt