Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 7 months ago.
how to use AnalogOut
Identifier AnalogOut is undefined
Question relating to:

2 Answers
7 years, 7 months ago.
The AnalogOut class only applies to microcontrollers with internal DACs.
Nucleo-F401RE does not have a DAC. Therefore, this class can not be used.
7 years, 7 months ago.
make sure you have a Library included which links to the api.
check the api again :
https://docs.mbed.com/docs/mbed-os-api-reference/en/latest/APIs/io/AnalogOut/#hello-world.
Try to import that into your online IDE and play with it.
Make sure the syntax is AnalogOut variable(Pin);
the api will store the value of the variable named variable, or any other name, in its logical equivalent to the Pin.
Not every Pin can be an AnalogOut!
You need to set a porper value for Pin, it's just a placeholder for a numeric value that defines the Pin number.
i.e A5 means Register A Pin 5, like in the API example.