Electronic – AVR ATMEGA644 print Local time

atmegaavr

From this tutorial, I can print local time when I code using codeblock.
https://www.tutorialspoint.com/c_standard_library/c_function_localtime.htm

I am measuring capacitance by atmega644. I read the capacitance data from the ADC and print it. I want to add the local time so that I can know how much is the capacitance at a specific time.

I try the exact same thing of this tutorial and get the following errors. How can I print local time along with my continuous capacitance measurement?

enter image description here

Best Answer

The full C library is not available on embedded devices. Consult the avr-libc manual to see what's available.

In practice, if you want a real-time clock on an ATmega microcontroller, you will probably need to implement it yourself using a timer configured to fire once per second. (This will also mean you will need some way for the user to set the current time.)