On Thursday 24 May 2007 01:26, Ng Mingjie Luke wrote: > Hi, > > I'm still relatively new to mote programming with tinyos-2.x and nesC, and > I'm wondering how to go about programming the GPIO pin on my mica2dot mote. > I want to try something simple, like making Led0 toggle whenever i apply a > hi voltage(battery voltage) to the GPIO pin INT0. Can that be done?
Yes, but it requires a couple of external components. Check out one of the hardware schematics at www.tinyos.net to see how to do it. In general, you'll want a pull-down (or pull-up) resistor to ensure the input doesn't float. You also may want a debounce cap if you are using a physical device like a switch to assert Vcc (or Vss) to the IO pin. Some of the circuits may also use a current limiting resistor. > After reading the manuals, I figured I should need to provide the > interfaces GeneralIO and GpioInterrupt right? But I can't seem to find a > component that provides the GeneralIO interface, and I can't seem to find > an implementation of GeneralIO. > > Any help would be greatly appreciated. Thanks! $TOSDIR/platforms/mica2dot/PlatformLedsC.nc exports three GeneralIO interfaces. One of them is 'real', wired to HplAtm128GeneralIOC.PortA2. For interrupts, look to wire to HplAtm128InterruptC.nc. All the best, Steve _______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
