I'm using Arduino and Processing to create an instrument that responds to touch by lighting LEDs and playing MP3 files.
My code was working until today. I don't know why it's not working. I'm a beginner with this stuff so I don't know how to fix it or what went wrong.
I'm getting a Null Pointer exception error highlighting the 'while (port.available () > 0 ){'
I tried changing the value to 1 and also tried putting a writing while (port.available () > 0 );{
but neither worked.
while (port.available () > 0) {
int myChar = (port.read());
if (myChar == 'A') { //CHECK ARDUINO INPUT AND PLAY CORRESPONDING TONES
player_1.cue(0);
player_1.play();
}