Report
2 weeks, 6 days ago.

how to use AnalogOut

Identifier AnalogOut is undefined

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F401RET6 microcontroller.
Comment on this question

2 Answers

2 weeks, 6 days 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.

Hello, The above answer is correct. STM32F401RE does not have a DAC, and is not compiled for the class ANALOGOUT. You may chose another platform.

You can find the list of STM32 devices that have a DAC in this document : http://www.st.com/content/ccc/resource/technical/document/application_note/05/fb/41/91/39/02/4d/1e/CD00259245.pdf/files/CD00259245.pdf/jcr:content/translations/en.CD00259245.pdf (table 2)

and you can find the list of ST platforms available in mbed here : https://developer.mbed.org/platforms/?pvend=10

kind regards Armelle

posted by Armelle DubocST 28 Jul 2017
2 weeks, 6 days 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.


To post an answer, please log in.