Can the voltage be send in Volts instead of millivolts?


#1

hi everyone,
When i type in the command at+adc? i got the results +ADC: 4145, 1393, 1387. But i only want change the 1387mv into volts and then send it out throught sms. Can it be done? Is there any reference that i can refer to?

Best Regard,
thia


#2

Simple:

  1. Convert the text string to a number;
  2. Divide by 1000;
  3. Convert the result back to a text string.

Or you could just infer the position of the decimal point from the number of digits… 8)


#3

Hiya,

And don’t forget that wm_sprintf() DOESN’T support the %f modifier.

See forum topic: http://www.wavecom.com/modules/movie/scenes/forums/viewtopic.php?f=19&t=365&p=4391&hilit=+sprintf+float#p4391

ciao, Dave