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