[Tinyos-help] Re: ADC on telosb

Poornima Jayarao pjayarao at yahoo.com
Tue Sep 27 14:02:29 PDT 2005

 Hi Joe,
 I am trying to use the ADC with an interrupt. 
 The attempt is to use the ADC once per int fired.
 So,upon (first) int fired, the global flag "once"
 calls start_sampling once, sets up DMA and 
 ADC as per your start_sampling code. Then 
 upon DMA0 transfer done the green led toggles. 
 But the second interrupt does not toggle the green
 Obviously I am unable to figure what I am doing 
 wrong in the code below. Please help.
 uint8_t once = 0; // setup ADC and DMA only once
 async event int.fired(){
 call int.clear() ;
 call int.disable();
 if(!once) {post int_process();}
 else { call DMA0.repeatTransfer((void
 call int.enable();
 task void int_process() {
 call Leds.greenOn();
 start_sampling() {
   if (!once) {
    .... Code here to setup DMA and ADC only once.
  async event void DMA0.transferDone(result_t s) {
  call Leds.greenToggle();

Yahoo! Mail - PC Magazine Editors' Choice 2005 

More information about the Tinyos-help mailing list