RTC component woes

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

trying to set the rtc values using a struct like in the example and I get this when I try and enter values..

   

 

   

.\main.c: In function 'main':
.\main.c:30:17: error: invalid digit "9" in octal constant
     Start.Min = 09u;

   

it happens for all struct variables.. it only accepts digits 0-7 instead of decimals.

   

what did I do wrong? otherwise my digital clock using a neopixel ring works good 🙂 just have to code the time setting method using switches.

0 Likes
7 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Can you post project so all of the affecting code can be examined -

   

 

   

Consider posting your project, makes life easier to troubleshoot.

   

 

   

“File”                                                             Creator

   

“Create Workspace Bundle”

   

 

   

 

   

Regards, Dana.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

will do and here ya are. its a minimum one.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I got only a couple of minor warnings, it compiled for me.....

   

 

   

Creator 3.2, SP1

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

even if you put a number higher than 7 in the start.sec or any of them?

0 Likes
Anonymous
Not applicable

C constant rules:

   

 

   

123 decimal constant

   

 

   

0123 octal constant

   

 

   

0x123 hex constant

   

 

   

Ed

0 Likes
Anonymous
Not applicable

ooooooh, now I see! I knew it had to be something I was doing wrong!

   

thanks much! now I can do it easier 🙂

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Ed,

   

Wow! well done. Since octal is so far away from my own thoughts it would never have come to my mind...

   

 

   

Bob

0 Likes