[Tinyos-help] tmote: user button question
Joe Polastre
joe at polastre.com
Thu Aug 3 09:16:45 PDT 2006
UserButtonC and UserButtonAdvanceC in Boomerang take care of these
issues and simply let you use the button with a Button interface
abstraction.
-Joe
On 8/3/06, Terence Joseph <tjormor at hotmail.com> wrote:
> Hello,
>
> I am using the following code which I borrowed from CountInputM.nc to allow
> me so send data whenever the user button on the tmote is pressed:
>
> async event void UserInput.fired(){
> call UserInput.disable();
>
> if (m_int == FALSE){
> call Leds.yellowOn();
> m_int = TRUE;
> }
> else{
> atomic DestinationAddress = TOS_UART_ADDR;
> post sendVariableCnt();
> call Leds.yellowOff();
> }
>
> call UserInput.clear();
> if (!m_taskposted)
> if (post startDebounceTimer() == SUCCESS)
> atomic m_taskposted = TRUE;
> }
>
> However, every time I install my application for the first time the blue Led
> (called with Leds.yellowOn()) goes on (as if the user button had been
> pressed even though it hasn't) and I have to press the reset button to
> restart the application. Can anyone explain why this is happening and what
> I can do to prevent it? Many thanks.
>
> Best Regards,
> Terence
>
> _________________________________________________________________
> Find a baby-sitter FAST with MSN Search! http://search.msn.ie/
>
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
More information about the Tinyos-help
mailing list