You have not:
Declared buttonPressed as a variable of type Boolean
Set buttonPressed as TRUE once button is pressed
Looked for button being released and resetting buttonPressed to FALSE
I have told you what to do twice but you still have not done it. Read what has been said previously and change your code accordingly.
Please put your code in its own window as seen in other posts. This can be done by placing [code] and [/code] around the code or use the </> icon. This makes it easier for others to read.
Weedpharma