Apologies for my lack of programming skills!
I'm reading an analog value from an IR sensor. Dividing that value by 4 gives me a suitable range of values between (around) 0 and 150. Ultimately I want it to send a midi CC message, but to begin with, I'm using serialprint to show the value onscreen.
I want the value to, in effect, trigger a switch, so if the value goes above (say) 75, it will display a message once then wait until the value falls below 75 and display an alternate message, again, just once. I've got it showing messages, but within the loop they keep coming and I want it to just alternate between two states, like a light switch.
I've seen some complex solutions for analog switching, but feel sure there must be a simple way...
Thanks in advance