I'm going to assume that the values you get are between 140 and 148
rather than being 148 thousand and change...

In which case, look in the Getting Started Manuals or search this
list for a conversion formula. There's probably even a FAQ on
docs.tinyos.net

MS


SHEN Zhong wrote:
> Hi, everyone
> 
> I want to get the battery of micaz mote. I use the component Voltage. The
> following code is about getting battery.
> 
> In configuration, i used following code:
> 
> MYAPP.VoltageControl -> Voltage;
> MAAPP.ADCBATT -> Voltage;
> 
> In module,
> 
> interface StdControl as VoltageControl;
> interface ADC as ADCBATT;
> 
> async event result_t ADCBATT.dataReady(uint16_t data)
>   {
>         atomic{
>               battery = data;
>         }
>       return SUCCESS;
>   }
> 
> After i got the battery value, the program send packet to base. I found
> the raw data about battery is nearly 140,148. It looks strange.
> 
> How could i convert the raw data to real battery voltage? micaz
> 
> Thank you very much.
> 
> Regards
> 
> Leo
> 
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

-- 
Platform: WinXP/Cygwin
TinyOS version: 1.x, Boomerang
Programmer: MIB510
Device(s): Mica2, MicaZ, Tmote
Sensor board: homebrew

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to