I am working on a project to read the analog signal from the input port of Arduino and print it to serial monitor i am unable to read the input signal with delay less than 4 ms, it works with delay higher than 4 ms .
I am working on a project to read the analog signal from the input port of Arduino and print it to serial monitor i am unable to read the input signal with delay less than 4 ms, it works with delay higher than 4 ms .
Another thought - You could run some tests - create a sample sketch to JUST read the ADC say, 10,000 times and see how long it takes to execute. Don't print anything to the serial port during that time. That could tell you if the serial port is slowing you down.
You could then also set up your code to only print periodically to the serial port - say only when the value changes by a certain amount; and also every 1-200 ms.
I also found this article that may have some stuff that helps you: https://forum.arduino.cc/index.php?topic=6549.0
Another thought - You could run some tests - create a sample sketch to JUST read the ADC say, 10,000 times and see how long it takes to execute. Don't print anything to the serial port during that time. That could tell you if the serial port is slowing you down.
You could then also set up your code to only print periodically to the serial port - say only when the value changes by a certain amount; and also every 1-200 ms.
I also found this article that may have some stuff that helps you: https://forum.arduino.cc/index.php?topic=6549.0