so im following this tutorial, and the topic is locked so i cant ask there
great work by him, and everything works up until i plug a second pot in.
code is the v1.3, and as soon as i plug in the second pot whenever i turn either, both paddles just start spasming out. I tried just reading 2 analog values individually to test and i noticed that the value is affected by the other one.
This example code is in the public domain.
https://www.arduino.cc/en/Tutorial/BuiltInExamples/ReadAnalogVoltage
*/
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A1);
int sensorValue1 = analogRead(A5);
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
float voltage = sensorValue * (5.0 / 1023.0);
float voltage1 = sensorValue1 * (5.0 / 1023.0);
// print out the value you read:
Serial.println(voltage);
Serial.println(voltage1);
delay (1000);
}
after reviewing and adding identifiers to the voltage, it all seems to work fine now, at least in this sketch. the game of pong is still broken.