Hi Lina,

You will need to capture the interrupt coming from the button push and act
on it accordingly. You will also probably want to debounce the button as
you're at it.

As an example take a look at TestUserButton in
tinyos-2.x-contrib/shimmer/swtest/UserButton

This app includes debouncing and is configured to use a button attached to
shimmer's external connector, i.e. port 20. The easiest way to change this
to use port 25  is copy the file
tinyos-main/tos/platforms/shimmer2r/HplUserButtonC.nc to your applications
directory and edit it accordingly (hint: see line 51). As an aside, this
will work because of the hierarchy used by tinyos' make system, i.e. files
in the applications folder are pulled in first (have a higher priority)
before they are searched for in other folders in the tinyos tree.

Once you have the button working in JustFATLogging (test by toggling an LED
to begin with), all you need to do is start recording in the .notify()
event, take a look at the FatFs.mediaAvailable() event for how to go about
this.

Mike

On Mon, Oct 18, 2010 at 7:22 PM, Lina Lundgren <[email protected]> wrote:

> Hi all,
>
> I have an extra-added push-button to my shimmer2r unit (in Port25) that I
> want to work as a start/stop signal for the JustFATLogging.
> Have anyone done this before and can help me on how to do this? I would be
> very greatful!!
>
> --
> Best Regards,
> Lina Lundgren
>
> --------------------------------------
>
> Halmstad University
> Email: [email protected]
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to