[Tinyos-help] About getting the battery of micaz

SHEN Zhong leoshen at ust.hk
Wed Dec 10 08:47:23 PST 2008


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



More information about the Tinyos-help mailing list