Hi, I'll post below what I'm using right now... As a sidenote, I have two variables you'll need. One is name "port1_trigger" and the other "Lift."
Code:
void Lift_Control ( void )
{
if ( port1_trigger == 1 ) // If the trigger was pressed last.
{
Last_Button_Pressed = 1 ; // Then the trigger was pressed last.
}
if ( port1_thumb == 1 )
{ // If the thumb button was pressed last.
Last_Button_Pressed = 2 ; // Then the thumb button was pressed last.
}
if ( Last_Button_Pressed == 1 ) // If the last button pressed was the trigger, then....
{
Lift = 1 ; // Lift the platform!
}
else
{
Lift = 0 ; // Don't lift the platform.
}
SetRelay ( 1 , Lift , -1 ) ; // The spike relay will have the value of the variable "Lift."
}
I hope that helps

-Nathan