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?



Microcontrollers have limited resources, like program data size, non-volatile memory size. The resource limitations stipulate that you cannot have just any number of stations you want. Do you ever wonder why it’s so much more expensive to get a 24-station sprinkler controller vs. a 6 station one?

Every coder is going to understand that “water time” is different from “time” or “datetime”?

Of course they have to: water time is ‘duration’, is the time between opening and closing the station; datetime is a time stamp and has nothing to do with ‘duration’. It won’t work if they do not understand the difference between the two.

Every coder is going to know how to convert “water time” to/from “time” or “datetime”, and be able to do the math?

As I said, the firmware can accept any input value, and converts it to its internal representation. Similarly it outputs value in a standard format. The math is done on the firmware side and is transparent to the user. But it’s important to understand that that the firmware has limited storage to represent the values, so it’s not possible to represent all values.

Even datetime has a limit: it’s usually represented by 4 bytes, which for practical purposes is sufficiently large. But of course it has a limit. When you reach the year 2200 you will see that coders have to understand the reason current datetime is insufficient.

no one has ever exposed their own data types. This sounds like to much dependence on other people.

All that I wanted to know from this survey is how accurate people need their water time to be. If they don’t need it to be accurate as seconds, why wasting the limited resources representing the seconds? This determines the best way to make use of the limited resources. I don’t think there is anything wrong asking this question.