|
Raghu, Thank you very much for your email and the suggestions.
We added in the calls to start() and init() for the sensors, but unfortunately
now this program is not returning any output. Do you (or anyone) have any
additional ideas about what could be causing this problem? (The code for
our module is included below.) Any advice would be greatly appreciated! Thank you, Gina Upperman module SenseToSensor{ provides { interface StdControl; } uses { interface StdControl as TimerControl; interface StdControl as TempControl; interface ADC as ADCTemp; interface Timer; interface SensorOutput as TempOutput; } } implementation { uint16_t TempReading; uint16_t counter = 0; command result_t StdControl.init() { call TempControl.init(); call TimerControl.init(); return SUCCESS; } command result_t StdControl.start() { call TempControl.start(); call TimerControl.start(); return call Timer.start(TIMER_REPEAT, 100); } command result_t StdControl.stop() { call TempControl.stop(); return call Timer.stop(); } event result_t Timer.fired() { if(counter < 19) { counter = counter + 1; } else { if(TOS_LOCAL_ADDRESS != 0) { call ADCTemp.getData(); } counter = 0; } signal SensorTimer.fired(); return SUCCESS; } void task outputTaskTemp() { uint16_t tCopy[5]; atomic { tCopy[0] = TempReading; } call TempOutput.output(tCopy, 0x0000, 0x0000, 0x0000,
0x0000, SENSOR_MSG); } async event result_t ADCTemp.dataReady(uint16_t data) { atomic { TempReading = data; } post outputTaskTemp(); return SUCCESS; } event result_t TempOutput.outputComplete(result_t success) { return SUCCESS; } -----Original Message----- Gina, You need to call the init and start methods when you wire to PhotoTemp module. For example when you wire to TempStdControl of PhotoTemp as follows: MyModule.TempControl -> PhotoTemp.TempStdControl; you will need to call TempControl.init() and TempControl.start() to use the temperature sensor. I used the sensor and it gives correct values. You will need to look into the manual of MTS300/MTS310 on how to convert the ADC values into temperature values. Also beware that the micaz reception fails when temperature
sensor is enabled. Read the MPR/MIB manual for Micaz (from xbow) to see how to get the fix. Also look at the example code in
$TOSROOT/apps/MicaSBVerify/MicaSBTest1/. Regards Raghu > Message: 4 > Date: Sun, 16 Apr 2006 18:42:19 -0500 > From: "Gina Upperman" <[EMAIL PROTECTED]> > Subject: [Tinyos-help] Turning on the temperature sensor for Micaz > motes > To: <[email protected]> > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="us-ascii" > > Hi All - > > > > I am using the MTS300CA sensor board on the Micaz motes and have
hooked it > up using the phototemp module. The temperature readings that
come in are > all stuck on C (12), so I think something is wrong. Do we
need to "turn-on" > or initialize the temperature sensor in some way? A few
posts from several > years ago mention this, but the files they reference seem to be
obsolete. > Has anyone had luck with using the temperature sensor, and was
there > anything extra that you had to do? Any advice would be
appreciated! > > > > Thank you, > > Gina Upperman > > > -- ================================= Research Assistant Department of Computer Science IL-61801 ================================= !DSPAM:4443a9c925405021468! |
_______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
