Trouble getting Firmata to take input

I've connected my Arduino to Processing using firmata and have confirmed they are communicating by turning the LED on the Arduino on and even making it blink. Now I am trying to get it to turn the same LED on when I'm using a limit switch and it isn't working. I put this exact same code (just formatted for the Arduino program) into the Arduino programming window and it works perfectly fine, but now it doesn't in Processing. When using the firmata_test.exe thing it shows that the pin is flickering a lot between high and low when I hold the limit switch down. Is this a problem with my wiring or firmata or my code? I have not changed the wiring between using it with Processing and the Arduino code.

I'm using Processing 3.5.4 and an Arduino Nano 33 IoT (I have added the necessary code to boards.h to get this board to work with Firmata)

Here's my code in Processing:

import cc.arduino.*;
import org.firmata.*;
import processing.serial.*;

Arduino arduino;

void setup(){
arduino.pinMode(13, Arduino.OUTPUT);
arduino.pinMode(7, Arduino.INPUT);
}

void draw(){
if (arduino.digitalRead(7) == Arduino.HIGH){
arduino.digitalWrite(13, Arduino.HIGH);
}
else{
arduino.digitalWrite(13, Arduino.LOW);
}
}

I see that you made an attempt to use code tags.

You're not supposed to put your code between the < and the /> :wink: You're supposed to use the </> button. Edit your post, select all code and click the </> button; next save your post.

Can't help you with your problem.

Okay I solved the problem so if anyone in the future comes looking at this forum post for answers here is how I fixed it:

I switched from StandardFirmata to SimpleDigitalFirmata or SimpleAnalogFirmata if you want to use Analog input, because that worked as well. If you have this problem and need your Arduino to read both digital and analog I can't help because the other versions of Firmata aren't working either. Also the flickering was solved by swapping out the resistor I was using from 4.7k (which was recommended by a tutorial) to 330.