There are various ways to read/write controller pins in TOS. I only use TOS1.x which had a set of macros: TOSH_ASSIGN_PIN(PWM1Aout, B, 5); // port,pin B5a == PWM1Aout TOSH_MAKE_PWM1Aout_OUTPUT(); TOSH_CLR_PWM1Aout_PIN(); TOSH_SET_PWM1Aout_PIN(); There are often modules to do the same thing with names like: MSP430GeneralIO.nc
Under T2 things have probably been more regularized... But you want to get to ports on a peripheral device, which may not be directly connected to controller pins. You'd have to examine the schematic to see how they are attached, and look for drivers for the board that might provide access. For instance, Xbow Moteworks has this intriguing file: opt/MoteWorks/tos/sensorboards/mda300/DioM.nc MS conque...@aol.com wrote: > > I have a micaz mote with a mda300 sensor board. I was wondering how I > take readings from the digital input lines (D7-D0). Do these lines > correspond to a port on the Atmega chip and if so can I read the pin's > state like I normally would on an atmel chip (i.e. i=PINB) or does > TinyOS have a special function for handling this? Thank you for any help. > > > ------------------------------------------------------------------------ > > _______________________________________________ > Tinyos-help mailing list > Tinyos-help@millennium.berkeley.edu > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help _______________________________________________ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help