Hi gang,
I'm looking for a creative way of managing a variable. Creative being a minimal amount of code. I need to store the state of 5 outputs on the fly, so that the last known state can be loaded upon startup.
With the 5 outputs, each can have 2 states (high or low). Each of the outputs can be changed independently, so the actual variable, including all high or all low, as best I can figure, has 17 possible states.
Is it better to do an evaluation of all the ports every time an output changes, and keep a small variable, or is it better to keep 5 variables and compare them together to get a single variable to write to memory?
Which method results in the smaller (and thus faster) code?
Thanks for any ideas
Gary
Bookmarks