Look at the ADC modules and their use in various demo apps,
e.g., Sense. You'll need to rummage around in the platform
directories to see the actual DemoSensor implementation.
If all you need to do is sample an analog input it should
be a straight-forward swap of ADCC for DemoSensor in the
config and then using getData() & dataReady() in your code.

MS

David Conde wrote:
> Hi Michael,
> 
> Thank you for your answer, it was very helpful for me.
> 
> I perfectly understood how I have to do it with your explanation.
> 
> What about if I try connect a sensor with analog output, would it be the
> same process as digital one?
> 
> I mean, if I would like to use a Sensor with analog output, I would place it
> in ADC2 (analog Input 2, which is the same pin as GIO1), could I use the
> same component (MSP430GeneralIO) with the same method as you told me
> before?How can Tinyos make the difference between use ADC2 and GIO1 if both
> of them are connected together?
> 
> Can I suppose that by default no pin in 10 Extensor pin connector is used if
> I have not matched in MyApplication configuration component? I mean, I could
> use GIO4, GIO5 and GIO3 as the same way as I would use GIO1?
> 
> I am using Tinyos1.x with Telosb motes.
> 
> 
> Thank you in advance and I am sorry for so many questions
> 
> 
> -----Mensaje original-----
> De: Michael Schippling [mailto:[email protected]] 
> Enviado el: lunes, 12 de octubre de 2009 18:45
> Para: chuso
> CC: [email protected]
> Asunto: Re: [Tinyos-help] How could I configure what sensor to get data from
> in my Telosb ?
> 
> You don't say what version of TOS you are using
> and I only know T1, but this is what I did to
> read a pin, and it might be the same in T2.
> Note that the Port23 name means Port 2 bit 3,
> so figure out what port/pin you want and use it:
> 
> In the config file:
>          MyApp.USIn0 -> MSP430GeneralIOM.Port23;
> 
> In the MyApp appication code file:
>    in the provides/uses block at the top:
>       uses interface MSP430GeneralIO as USIn0;  // PORT23
> ...
>    in init():
>       call USIn0.makeInput();
>          call USIn0.selectIOFunc();
> 
>    where you want to use it:
>       // look at input value
>       if( call USIn0.get() == FALSE )
> 
> 
> MS
> 
> chuso wrote:
>> Hi again,
>>
>> I have been reading the code in oscilloscope and I found TempHum component
>> which models the Sensirion Temperature and Humidity sensors, althoug I did
>> not understand very well what exactly this component does. 
>>
>> I found either the hardware schema of Telosb and I saw that there is 4
> GIO,
>> both of them (GIO2 and GIO3) are connected with ADC2 and ADC3 together.
> With
>> this,  I would like to integrate a PIR sensor, which have digital output.
> I
>> have thought connect this digital output to the GIO1, which is connected
>> with ADC2 IO. What do I have to do to get the data from this GIO?I mean,
> how
>> I have to configure the hardware.h or whatever other NesC component in
> order
>> to achieve to get data from this GIO without to cause error in the other
>> funcionalities?
>>
>> Thank you in advance 
>>
>>
>> Michael Schippling-2 wrote:
>>> Most of the example apps use a DemoSensor component as the data source.
>>> Each platform has a different implementation, depending on the native
>>> sensors available. You can just replace DemoSensor with an appropriate
>>> ADC in the config file. Dig through the code to find the DemoSensor
>>> implementation that your system is using, or search for other uses of
>>> ADC, to see a usage example
>>>
>>> MS
>>>
>>> David Conde wrote:
>>>> Hi,
>>>>
>>>>  
>>>>
>>>> I have been Reading about ADC component and Oscilloscope application and
> 
>>>> I would like to know how I can change the sensor to get data from, I 
>>>> mean, I am working with TelosB, and it has three sensor to get data from
> 
>>>> them. I would like to change the configuration on Oscilloscope to get 
>>>> data from Humidity sensor instead of light sensor and to know how could 
>>>> I include a new digital sensor as a PIR sensor using TelosB mote?
>>>>
>>>>  
>>>>
>>>> Thanks in advance
>>>>
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>> _______________________________________________
>>>> Tinyos-help mailing list
>>>> [email protected]
>>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>> _______________________________________________
>>> Tinyos-help mailing list
>>> [email protected]
>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>
>>>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to