|
Hi all,
I'm trying to read the battery voltage to adjust my
ADC scale on mica2 motes. I followed the instructions in User Manual to set the
BAT_MON pin high. What I am not really sure is do I have to connect ADC7 pin to
BAT_MON or this is somehow done internally?
Here is the example of my code that doesn't work (I
tried to follow the examples already available). Can anyone point out what is
wrong with it? I am using this file to read the pressure using TinyDB
application.
I added the following to my sensorboard
file:
#define MAKE_BAT_MONITOR_OUTPUT() sbi(DDRA, 5) #define MAKE_BAT_ADC_INPUT() cbi(DDRF, 7) #define SET_BAT_MONITOR() sbi(PORTA, 5) #define CLEAR_BAT_MONITOR() cbi(PORTA, 5)
I wired this in my Pressure.nc file PressureM.BattControl ->
Voltage;
And my whole PressureM.nc file is:
includes sensorboard; }
//Pressure call
ADCControl.bindPort(TOS_ADC_PRESSURE_PORT,
TOSH_ACTUAL_PRESSURE_PORT);
TOSH_SET_PRESSURE_CTL_PIN(); //n-channel on --> p-channle
on async command result_t ADC.getData() //
SET_BAT_MONITOR(); //already
done in VoltageM.nc call Timer.start(TIMER_ONE_SHOT, 12);
//AP to extand PW duration from 8ms to
20ms
async command result_t
ADC.getContinuousData()
|
_______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
