Two Arduinos - One Pot

If I had two arduinos reading the output of 1 potentiometer, would that create inaccuracies with the reading of the code on both arduinos were both mapping the input?

I'm assuming that 5V and GND from both arduinos is still required on both sides of the pot.

The purpose of this is to have one Arduino run a 20x4 LCD and the other to drive the rest of the main programming without being slowed down by the LCD.

If I had two arduinos reading the output of 1 potentiometer, would that create inaccuracies with the reading of the code on both arduinos were both mapping the input?

It would be possible.

I'm assuming that 5V and GND from both arduinos is still required on both sides of the pot.

No. Never connect the 5V lines together. The grounds must be connected together but only use one of the Arduino's 5V lines for the pot.

The purpose of this is to have one Arduino run a 20x4 LCD and the other to drive the rest of the main programming without being slowed down by the LCD.

I remain unconvinced that you need two Arduinos, it is often a beginners guess at a solution when they don't know what they are doing or can't code properly. I am even less convinced that it is the answer in your case.

1 Like

The main reason for the separate Arduino was due to speed delay issues when driving a stepper motor. I was running a simple program to drive a stepper motor at a speed determined by a mapped potentiometer (300 - 4000). I then added a serial.begin and serial.print to the program to read the pot and the over speeds of the stepper were slower after the fact. I then inquired if instead of printing to the serial I printed to an LCD, would the result be worse. A brittain member said yes.

I'm open to recommendations as always.

Had to look back to see who it was and it was per your recommendation Mike

https://forum.arduino.cc/index.php?topic=562443.0

Am I still misunderstanding something?

Don't write so much that You fill the output buffer. That will slow down Your loop and stepper speed. You got a piece of code to cure that. Did You try it?

Railroader:
Don't write so much that You fill the output buffer. That will slow down Your loop and stepper speed. You got a piece of code to cure that. Did You try it?

Going to have to wait until tomorrow when I get back to work. I'll let you know how it works out.

Only write to the LCD when something changes, most likely that is much less often than you would think, and ages apart in microcontroller time.

CrossRoads:
Only write to the LCD when something changes, most likely that is much less often than you would think, and ages apart in microcontroller time.

I think I understand what your saying here but I'm not sure how to code that. If I understand correctly, it's something along the lines of

  • read and print current state
  • if something changes, then and only then send new info to LCD to reprint

Is this close to what you were saying?

Yes, You are closing in.
Serial print only when data is changed would increase the performance but it has one, short time, weakness. If You make large changes on the pot You will get plenty of Serial prints and possibly a hick up until a steady state is reached regarding the pot.

Test the interval time for printouts that I sent You earlier. Anything from 2 printings to 10 per second I see as meaningful. This calls for millis()+500 down to millis()+100 in that piece code.
You have no use of hundreds or a thousand updates per second.