Time to start putting things together. Counting C10 time is a really simple thing.
Here is the code that does the whole job of counting time and date:
// C10 date/time structure
struct {
unsigned char tick; // 0..99
unsigned char centival; // 0..99
unsigned char interval; // 0..99
unsigned char day; // 0..9
unsigned char decade; // 0..36
unsigned int year;
} dt;
// must be executed at every exact 0.0864s (one tick)
void clockC10(void) {
if (++dt.tick>99) {
dt.tick=0;
if (++dt.centival>99) {
dt.centival=0;
if (++dt.interval>99) {
dt.interval=0;
if (++dt.day>9) {
unsigned char yl=36; // year length
// the year will have 37 decades if odd
// number or multiple by 40
if ((dt.year&1) || (dt.year%40)==0) yl++;
dt.day=0;
if (++dt.decade>=yl) {
dt.decade=0;
dt.year++;
}
}
}
}
}
}
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
'tenary' is an interesting suggestion. Trying in on my tongue now and it sounds fine. A possible candidate. I will update the project description to include it in the list of suggestions
Are you sure? yes | no
Just use the proper prefix from metric system as your are doing metric time.
https://en.wikipedia.org/wiki/Deca-
e.g. Deci_Year for 1/10 of a year, Deca_Day for 10 days etc.
Are you sure? yes | no
'decaday' is a bit tricky for pronunciation, I think...
Are you sure? yes | no
So are the IUPAC organic compounds naming. If you want a non-arbitrary and accurate description of it, following the standard is the way to go. Everyone else could call it metric week or whatever.
Are you sure? yes | no
That is undeniably correct. I will add this suggestion to the project description.
Are you sure? yes | no
Neat! Isn't there another term for 'decade', as it suggests 10 years instead 1/10th of an year?
Are you sure? yes | no
'decade' is actually 10 days in C10. I simply wasn't able to come up with another word for it. It is not unambiguous as the others as it might also refer to (as you already said) 10 years, but what else could be called a period of 10 days?
Are you sure? yes | no
I've been thiking about a good word for that. What do you think of 'tenary'?.
Are you sure? yes | no