Reading ADC

Hi,

I´m trying to read my ADC values. I powered de DK with USB and trying to read sensormeasurements, but I can´t see the right values. 

I´m trying to read with the 12-bit ADC. The sensor gives 4-20mA and I measure over a resistor of 150 ohm. 

So the calculation = m_sample * 3.0 / 4096 = measured volts

Is this the right way?

val0 = m_sample * 3.0 / 4096;
printf("%.2f", m_sample);
sprintf((char*)data0, "%.2f", val0);
memcpy(&data_array[0], &val0, sizeof(val0));

This is a snippet of my program. After this I send the values with ble_nus_send.

Is this right? Can it be that I did something wrong, so blowed up the pin. Because a month ago the measurement were right. 

Related