cant write to my RTC

okay so i need your help.

i built an app on Mit app inventor and it includes setting the time of my rtc.

the app sends out the time in text (string, maybe there is a way it can be sent in hex already?? idk). and i need it to be in hex so i could send the data to my rtc and set the time.

idk what am i doing wrong like maybe there is a simple way to get it into hex

but i just dont get it ive managed to get it from string into an int but its in decimal base

i hope youll understand what im saying but i really need some help im lostttt.

No I don’t understand. Why would the time be in hex? Can you post an example time, in hex so we can see what that looks like?

Which RTC library are you using?

rtc_address=7; write_rtc(0x11); rtc_address=sec_addres; write_rtc(0); rtc_address=min_addres; write_rtc(0x0); rtc_address=hour_addres; write_rtc(0x12);

i did managed to get the text from the app into the arduino turn it into an integer and send it to the rtc

but if i send like the number 23(int, 10 base) it would come out as 17 because its in hex..

Read my signature. It says, "Please don't PM me with technical questions. Post them in the forum."

Study BCD (binary coded decimal). What you are asking has almost nothing to do with hex, except for the happy coincidence that hexidecimal digits are a convenient way to code BCD values in C/C++ source. But in your application, the digits are not embedded in the source, they are coming from the serial stream.

You haven't explained the full context in which you are using the digits. Can you control the way your PC application can format the string? Do you have the part about sending and reading the string completed? Please post and explain any code that you have already produced.

Probably, you will need to do an integer to BCD conversion. You can google that too.