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.
9 years, 8 months ago.
possible to use AnalogOut and AnalogIn on nrf51822 ?
Hi,
i'm trying to use Analgon I/O with nrf51822 but whent i try with out I got an error :
Error: Identifier "AnalogOut" is undefined in "main.cpp", Line: 42, Col: 2
And when i try with AnalogIn, i got the hex but after upload on nrf51 dongle, the rgb led blink with all colord and my soft is not working ...
If someone can help me, ty
1 Answer
9 years, 8 months ago.
It apparantly has no AnalogOut. Regarding AnalogIn, are you using it for pins which are listed as AnalogIn pins on the pinout picture?
Hi,
i'm using nrf51 dongle and i'm not sure it there is Analong In ... where can I found this ?
on the nrf51822 page (https://www.nordicsemi.com/eng/Products/Bluetooth-Smart-Bluetooth-low-energy/nRF51822#sthash.7M6XwwAc.dpuf) there is Configurable I/O mapping for analog and digital I/O
edit : I found the answer on the doc, there is just digital pin on nrf51 dongle.
posted by 13 Mar 2015Hello! The link above bring us to a general information. Where can we find the name or the mapping related to AnalogIn? I mean, how is this? "AnalogIn analog_value(P0_6);" Is P0_6 a valid definition?
I am using it but get a value of 0 when reading the port. example: level = analog_value.read(); This does not return any value.
............
Sorry I found my mistake. The returned value is float and I used int. Anyway the above comment about the analog port definition seems to be correct.
posted by 11 Apr 2015