Created
March 23, 2022 14:29
-
-
Save cmoz/bb47e587ba89859321e88b9bee3b2a86 to your computer and use it in GitHub Desktop.
Reads in 4 analog values and outputs to serial plotter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Created by ArduinoGetStarted.com | |
* | |
* This example code is in the public domain | |
* | |
* Tutorial page: https://arduinogetstarted.com/tutorials/arduino-serial-plotter | |
*/ | |
void setup() { | |
Serial.begin(9600); | |
} | |
void loop() { | |
int y1 = analogRead(A0); | |
int y2 = analogRead(A1); | |
int y3 = analogRead(A2); | |
int y4 = analogRead(A3); | |
Serial.print(y1); | |
Serial.print(" "); // a space ' ' or tab '\t' character is printed between the two values. | |
Serial.print(y2); | |
Serial.print(" "); // a space ' ' or tab '\t' character is printed between the two values. | |
Serial.print(y3); | |
Serial.print(" "); // a space ' ' or tab '\t' character is printed between the two values. | |
Serial.println(y4); // the last value is followed by a carriage return and a newline characters. | |
delay(100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment