im having problems thinking the right code to do the folowing :
the circuit is very simple just 2 bottons...2 inputs and 1 output
botton1
botton2
i have to press botton1 and keep it press, then with botton1 presed, press botton2 then release botton1 first and then release botton2.... if is only in that orderd activate the output (HIGH)
You need to have a variable to record the state of the system as the process of button presses proceeds. Let's call it actionState.
Something like this pseudo code
If no button is pressed actionState = 'n'
if actionState == 'n' and btn2 is pressed
actionState = 'e' // for error - to prevent starting with btn2 down
if actionState == 'n' and btn1 is pressed
actionState == '1'
if actionState == '1' and btn1 is not pressed
actionState = 'e'
if actionState = '1' and btn2 is pressed
actionState == '2'
if actionState == '2' and btn2 is not pressed
actionState = 'e'
if actionState == '2' and btn1 is not pressed
actionState = '3'
if actionState = '3' and btn2 is not pressed
actionState = '4'
if actionState == '4'
output = HIGH
I can't see anything wrong with it, on a first read through. Show us a schematic of your hardware. Have you written a simple sketch, just to test the buttons and indicator functionality?