Quote: ":state=0:state=1
:state=1,scancodekeypressed=49:ambience=50,ambiencegreen=180,state=2
:state=2,scancodekeypressed=50:ambience=0,ambiencegreen=0,state=0"
You challanged us to manipulate it so that you can use a single key, I accept that challange.
First off, recognition of the problem, pressing the "N" key will fill the keybuffer with multiple values of N, this means that N isn't really pressed once, it is pressed multiple times for the duration it is pressed.
The solution, rather obviously, while N is pressed you can NOT check it again so...
:state=0:state=1
:state=1,scancodekeypressed=49:ambience=50,ambiencegreen=180,state=2
:state=3,scancodekeypressed=49:ambience=0,ambiencegreen=0,state=4
:state=500:state=2
:state=2,scancodekeypressed=49:state=500
:state=2:state=3
:state=501:state=4
:state=4,scancodekeypressed=49:state=501
:state=4:state=1
if I did this right the two separated code packets will go in an infinite loop while scancode 49 returns true. when they break from the loop it proceeds to the following state.
Possible Errors, I can not tell you how FPSC handles this new scancodekeypressed, it is possible that there are brief pauses that will make this code not work propperly, in that case you will have to either resort to use of a timer, or a random= as a timer.
Wisemen are hard to find, they are tarnished by sayings and quotes that are not of their true nature.