You can put the ASSIGN in any "global" context -- outside of a function definition. The MAKE*OUTPUT would usually go in your init() or start() functions. The SET and CLR go where you want them to set and clear stuff. Search for uses of the sub strings, like "TOSH_SET", in the existing code to see how they get used.
MS Siddharth Trivedi wrote: > Hi everyone, > > I am trying to build a wireless switch using MICAZ motes, where an > input at one mote causes a bulb to light up at another mote. The > problem I am facing is one that I find has been discussed already on > this forum, that of reading an input from an individual pin. From > previous posts, I gather that any communication with a port can be > carried out in the following three steps : > 1. Assign a name to a port+pin. - TOSH_ASSIGN_PIN(XYZ, B, 5); > 2. State whether the pin is input or output. - TOSH_MAKE_XYZ_OUTPUT(); > 3. Set/Clear or Read the pin. - TOSH_SET_XYZ_PIN() > I cannot understand how do I use these macros. My question is where in > my code can I place them. Can I assign a port+pin anywhere in the > implementation of my module? Will I have to include some header file > to the module in which I am using these macros? Are there any > examples/literature available for the atm128 microcontroller that can > help me understand how to solve the issue of input/output from an an > individual pin? I am extremely new to TinyOS and NesC, and any help > would be most welcome. > > Regards, > Siddhartha. > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help -- Platform: WinXP/Cygwin TinyOS version: 1.x, Boomerang Programmer: MIB510 Device(s): Mica2, MicaZ, Tmote Sensor board: homebrew _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
