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, 8 months ago.
mDot internal temperature sensor
I am having trouble reading mDot internal temperature sensor and battery level when using libmDot-mbed5 and mbed-os 5. Code works OK with mbed 2.
mbed 2
#include "mbed.h" AnalogIn vrefint(ADC_VREF); // Linear voltage regulator AnalogIn tempint(ADC_TEMP); // Internal temperature sensor (see user manual) Serial pc(USBTX, USBRX); int main() { float temp = 0, vref = 0; float VDDA = 3.174; // mDOT - VDDA (VREF+) pin voltage pc.baud(115200); while(1) { temp = (VDDA * tempint.read() - 0.76f) / 0.0025f + 25.0f; vref = VDDA * vrefint.read(); pc.printf("Temp: %f, Vref: %f\r\n", temp, vref); wait(1); } }
Question relating to:
1 Answer
7 years, 8 months ago.
Hi Alejandro,
So the "libmDot-mbed5" is pre-compiled at the moment and built with a specific version of mbed-os that has to be placed into your program as the same version.
If you look at the history here for the library, you can see which version of mbed OS you require for the version of "libmDot-mbed5"
https://developer.mbed.org/teams/MultiTech/code/libmDot-dev-mbed5/shortlog
Regards,
Andrea, team mbed
UPDATE: Using mbed-os-5.2 internal sensors work as expected. The problem is with mbed-os-5.1.5. Is there a way to solve this issue for mDot?
posted by Alejandro Veiga 28 Feb 2017