6 years, 9 months ago.

how to use AnalogOut

Identifier AnalogOut is undefined

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F401RET6 microcontroller.

2 Answers

6 years, 9 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.

Accepted Answer
6 years, 9 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.