• AVR Freaks

Helpful ReplyHot!PIC32 and RTCC

Author
Izseko
New Member
  • Total Posts : 28
  • Reward points : 0
  • Joined: 2019/10/12 07:47:06
  • Location: 0
  • Status: offline
2020/06/05 06:53:13 (permalink)
0

PIC32 and RTCC

Hello,
 
I'm developing control panel using PIC32MX530 and OLED. Right now working on Time/Date adjusting for users. 
My question - what kind of protection you suggest against stupidity, for example if user will try to set 31st of February? There are two options for February (28 or 29 days), how can i know many days will be in February in selected year. 
And second question - can RTCC detect exact weekday in case if I set only year, month and date right after power up?
 
Thank you in advance.
#1
Gort2015
Klaatu Barada Nikto
  • Total Posts : 3992
  • Reward points : 0
  • Joined: 2015/04/30 10:49:57
  • Location: 0
  • Status: offline
Re: PIC32 and RTCC 2020/06/05 09:15:00 (permalink) ☄ Helpfulby Izseko 2020/06/05 23:53:42
2 (1)
Depends if it is a Leap Year.
 
Leap Year when can divide by 4 but not 100 unless can divide by 400.
 
The whole date is validated.

MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
https://www.youtube.com/watch?v=Iu1qa8N2ID0
+ ST:Continues, "What Ships are Made for", Q's back.
#2
Gort2015
Klaatu Barada Nikto
  • Total Posts : 3992
  • Reward points : 0
  • Joined: 2015/04/30 10:49:57
  • Location: 0
  • Status: offline
Re: PIC32 and RTCC 2020/06/05 09:21:11 (permalink) ☄ Helpfulby Izseko 2020/06/05 23:53:31
0
The Week Day is a counter from 1 to 7.
 
The Day has to be calculated from the date
or entered manually.
 

MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
https://www.youtube.com/watch?v=Iu1qa8N2ID0
+ ST:Continues, "What Ships are Made for", Q's back.
#3
Izseko
New Member
  • Total Posts : 28
  • Reward points : 0
  • Joined: 2019/10/12 07:47:06
  • Location: 0
  • Status: offline
Re: PIC32 and RTCC 2020/06/05 23:53:50 (permalink)
1 (1)
Thanks for your response Gort2015.
Now everything is clear for me.
 
 
#4
Jump to:
© 2020 APG vNext Commercial Version 4.5