Python – Using Arduino/Processing to print text on screen when an LED light up

arduinojavaledprocessingpython

I have a question regarding the programming of printing text on the screen after an LED lights up on a breadboard. Should we plug in the LED into the Arduino board or a regular breadboard? How do I get the Arduino to recognize that the LED has lit up? I am doing a physical game where if you touch the wire with a wand, a buzzer and a LED lights up, which is currently connected as a parallel circuit.

Thank you very much in advance!

Best Answer

You don't want your Processing sketch to detect when the LED lights up. Per your description, you are touching a wire with a wand. This wire, which I will assume is some kind of switch, has to go into one of the pins on the Arduino that has been configured as an input. Your Arduino code is then responsible for detecting a change on this input, and then will set the output bit high (or low, if that's how your circuit is set up) to turn on the LED and buzzer. It is this change in the input that you will also use to make the text appear on the screen.