[Tinyos-help] Which ADC module to use

Ian Welch iwelch82 at gmail.com
Wed Aug 2 09:24:47 PDT 2006


Hi, Currently I'm using the Atm128AdcC module and I'm a bit confused on how
to use the Atm128AdcMultiple interface. How do I set my next conversion to
be on another channel? This is what I have so far. I get a conflicting types
error message for Multiple.dataReady when I try to compile, have I done
somethign wrong in the event?

****InsoleAppC.nc******
implementation {
     components Atm128AdcC as MyADC;
     ....
    InsoleC.Multiple    -> MyADC;
    InsoleC.Resource    -> MyADC.Resource;
    ....
    }

****InsoleC.nc******
module InsoleC {
   uses interface Atm128AdcMultiple as Multiple;
   .....
   }

implementation
   {
   .....
   event void Multiple.dataReady(uint16_t data, bool precise, uint8_t
channel, uint8_t *newChannel, uint8_t *newRefVoltage) {
        if(precise == TRUE) {
            *newChannel = channel+1;
            sample[channel + sample_num] = data;
            if(channel == 7) {
                call Resource.release[1]();
                post sendPacket();
                }
            }
        }
   ......
    }


Any help would be great. Also, am I using the correct Module? I'm just
getting in to TOS2.x and still a bit unclear on the order of things.
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20060802/d81b48e1/attachment.htm


More information about the Tinyos-help mailing list