Comments on: How to Adjust X and Y Axis Scale in Arduino Serial Plotter (No Extra Software Needed) https://www.open-electronics.org/how-to-adjust-x-and-y-axis-scale-in-arduino-serial-plotter-no-extra-software-needed/ Open source electronic projects Mon, 03 Feb 2025 20:31:12 +0000 hourly 1 https://wordpress.org/?v=6.8.3 By: Gamini https://www.open-electronics.org/how-to-adjust-x-and-y-axis-scale-in-arduino-serial-plotter-no-extra-software-needed/#comment-13433 Mon, 03 Feb 2025 20:31:12 +0000 https://www.open-electronics.org/?p=37387#comment-13433 I tried your suggestion to stop Y axis autoscaling
“Define Horizontal Lines in the Code: In your Arduino sketch, add the following lines to set Y-axis limits:
Serial.print(“1.1, “); Serial.print(“-1.1, “); ”

But Y axis keeps autoscaling. Please help.

Here is the complete program.
/*
ReadAnalogVoltage
Center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
modified by yours truly, Dr. G
*/
// 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(A0);
// Convert the analog reading (which goes from 0 – 1023) to a voltage (0 – 5V):
float voltage = sensorValue * (5.0 / 1050.0);
// print out the value of the potentiometer as an interger only:

Serial.print(“5, “);
Serial.print(“0, “);
float pi = 3.14;
int value = (int)pi;
Serial.print(“voltage:”);
Serial.println(voltage,0);
delay(200); // delay in between reads for stability
}

]]>
By: Gamini https://www.open-electronics.org/how-to-adjust-x-and-y-axis-scale-in-arduino-serial-plotter-no-extra-software-needed/#comment-13432 Mon, 03 Feb 2025 20:28:52 +0000 https://www.open-electronics.org/?p=37387#comment-13432 I tried your suggestion:
Define Horizontal Lines in the Code: In your Arduino sketch, add the following lines to set Y-axis limits:
Serial.print(“1.1, “); Serial.print(“-1.1, “);

But the Y axis keeps autoscaling. Please help. Copied below is the whole program

/*
ReadAnalogVoltage
Center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
modified by yours truly, Dr. G
*/
// 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(A0);
// Convert the analog reading (which goes from 0 – 1023) to a voltage (0 – 5V):
float voltage = sensorValue * (5.0 / 1050.0);
// print out the value of the potentiometer as an interger only:

Serial.print(“5, “);
Serial.print(“0, “);
float pi = 3.14;
int value = (int)pi;
Serial.print(“voltage:”);
Serial.println(voltage,0);
delay(200); // delay in between reads for stability
}

]]>
By: Jack https://www.open-electronics.org/how-to-adjust-x-and-y-axis-scale-in-arduino-serial-plotter-no-extra-software-needed/#comment-13428 Thu, 16 Jan 2025 16:02:39 +0000 https://www.open-electronics.org/?p=37387#comment-13428 Works great. On my Mac Sonoma 14.3.1 I used the path Applications/Arduino/ IDE.app/Contents//app/Resources/lib/backend/resources/arduino-serial-plotter-webapp/static/js//Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/resources/arduino-serial-plotter-webapp/static/js/main.35ae02cb.chunk.js

]]>