- The printf() and scanf() functions require a significant amount of memory, so it is recommended to use microcontrollers with memory equal to or greater than the ATmega328P (32K bytes FLASH).
-Wl,-u,vfscanf -lscanf_flt -lm -Wl,-u,vprintf,-lprintf_flt,-lm
- libprintf_flt
- libscanf_flt
You can download the src and include folder and save it in your project, adding the directive #include <include/uart.h>
.
I recommend using the PlatformIO extension, as its framework makes it easier to work with and download libraries. If you have experience in web development, you will find it very convenient.
- Open PlatformIO Core CLI
- Change directory (cd) to the PlatformIO project where platformio.ini is located.
- Copy the following pio pkg install command and paste into the CLI shell, press Enter
pio pkg install --library "marti-beta/uart-AVR@^1.1.0"
- Add the following line to your source code:
#include <uart.h>