It's a little harder to find than the equivalent OUTPUT version but you
can see the basics in platform/mica2/hardware.h and HPLCC1000M.nc

    // in hardware.h
    TOSH_ASSIGN_PIN(CC_CHP_OUT, A, 6); // chipcon CHP_OUT

    // in HPLCC1000M.nc
    TOSH_MAKE_CC_CHP_OUT_INPUT();
    cVal = TOSH_READ_CC_CHP_OUT_PIN();

Where "CC_CHP_OUT" is assigned to be the TOSish name for portA pin 6,
then set to be an INPUT, and finally the value read from it.

For completeness sake, you can also do pin outputs:
    TOSH_MAKE_CC_CHP_OUT_OUTPUT();
    TOSH_CLR_CC_CHP_OUT_PIN();  // to clear to 0
    TOSH_SET_CC_CHP_OUT_PIN();  // to set to 1


These multi-level macros are initially defined in
    platform/avrmote/arvhardware.h
The READ version boils down to doing an inp() on the port and
testing the relevant bit. CLR and SET do cbi() or sbi().

MS

antonio gonga wrote:
Hello,

I'm doing one project connected with network sensors, but i can not continue because i don't know how to read a sensor pins connected in 51-pin Interface, please if anyone knows how can i do that(it) , make know me..

respectefully Antonio Gonga


------------------------------------------------------------------------

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to