Hello, I'm a college student working on a project. I'm going to measure the power through STM32 in an arduino IDE and try to print it out in serial. What I'm doing now is adding a library dedicated to STM32 to the board manager.
Q1. Can STM32 also use the energy monitor library in the arduinoIDE like the arduino?
Q2. How can I measure the power and check the serial output using the upload method SWD?
I would appreciate it if you could let me know in detail.
I'll add a picture.
The SWD interface of the STM32 is only used for programming. You can't use it for serial communication. In order to do that, you will need to connect the STM32 to your computer in a manner that allows it to communicate via a serial port. The STM32 board likely has a USB socket that allows it to communicate with the computer via a USB CDC serial port. If not, you can connect a USB to serial bridge adapter module or cable (AKA "FTDI") to the UART pins on the STM32).