View Single Post
  #2   Spotlight this post!  
Unread 10-02-2005, 02:31
russell's Avatar
russell russell is offline
Registered User
#1430 (WRONG)
Team Role: Electrical
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Anchorage AK
Posts: 402
russell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to all
Re: One button wonder

how about this

Code:
//somewhere at the top of user_routines.c
int buttonstate=0;


//then later....

if(buttonstate==0 && p1_sw_trig==1)
{
//do some stuff here
buttonstate=1;
}

if(p1_sw_trig==0)
{
buttonstate=0
}
I am really sleepy and not thinking quite right just now, but that should do sort of a latching thingy. Maybe where it says to put the stuff you could increment another variable then based on the value of that variable decide what to do... something like that.