[Tinyos-help] TinyOS MICAz GpioInterrupt

Vivek Agate vivek.agate at gatech.edu
Mon Jul 6 11:16:16 PDT 2009


Hi,

I am trying to use the GpioInterrupt interface. Given below is the program
that I am using. The program toggles an LED whenever there is a falling edge
on Pin 6 (Intr 0).
However, the program does not work. The LED does not toggle at all. Can
anyone help me out in this regard?

I am using TinyOS version 2.1.0, MicaZ(MPR2400CA)

------------------------------------------------------------------------------------------------
GpioAppC.nc

configuration GpioAppC
{
}
implementation
{
  components MainC, GpioC, LedsC;
  components GpioInterruptC;


  GpioC -> MainC.Boot;

  GpioC.Leds -> LedsC;
  GpioC.Intr -> GpioInterruptC.Int0;
}

-----------------------------------------------------------------------------------------------
GpioC.nc

module GpioC @safe()
{
  uses interface Leds;
  uses interface Boot;
  uses interface GpioInterrupt as Intr;
}
implementation
{
  event void Boot.booted()
  {
        call Intr.enableFallingEdge();
  }

  async event void Intr.fired(){
        call Leds.led0Toggle();
  }
}

Thanks
Vivek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20090706/4a60a17d/attachment-0001.htm 


More information about the Tinyos-help mailing list