OpenSprinkler › Forums › OpenSprinkler Unified Firmware › Survey: can ‘station water time’ fit in 1 byte? › Re: Re: Survey: can ‘station water time’ fit in 1 byte?
@iDoug: here is another version based on your proposal: the first 2 bits represent units (second? minute? hour? day?) and the remaining 6 bits represent value. This will waste some values (like 24 hours and 1 day is the same), but simplifies the conversion.
After thinking about this idea, I am confused. It appears you are saying that the user would select second, minute, hour or day. The the value of that would be a maximum of 63 as 6 bits has 64 values. Which would mean if a user selected 1 hour and 30 minutes the function would throw an error as this exceeds the lowest common denominator of minutes which has a value of 90. In other words the user is limited to 63 seconds OR 63 minutes OR 63 hours OR 63 days. What did I miss?