This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

time calcultion

Other Parts Discussed in Thread: MSP430F2274

hi everyone..

i need assistance in calculating present time... using msp430f2274, what commands or any builtin ftn that could i use ...

example : output shoul be like :  12:50:24

regards

shazaib

 

  • It's not clear what you want to do. Wher ecomes 'present time' from? The 2274 doesn't know about 'time', it only knows about 'timing' in the sense of clock cycles. Relative to clock speed.

    So for giving you a hint, knwoign what you have is as important as knowing what you want.

    With the information you provided, the generic answer would be:

    ptintf ( "%d:%02d:%02d", hours, minutes, seconds);

    Which is a plain C problem/solution and not MSP430 specific.

  • i want to calculate present time...

    5:56:23  hour:minute:second

    using msp430f2274...

  • Repeating the original questions doesn't make it clearer.

    For presenting a time value from three separate variables (hour, miniute, second), I already posted teh solution: printf.
    However what do you mean with calculate? calculate what? What 'present time'? The MSP doesn't know the time, so it must come from somewhere. From where? in what format?
    And what do you want to calculate?

    There is no math formula that gives you present time, since the formula doesn't change but current (I assume that is what you mean with 'present') time does.

    If you want more than a a one-lined answer, you really should invest in more than a one-lined question.

**Attention** This is a public forum