Skip to content

Instantly share code, notes, and snippets.

@Jl9549
Last active April 23, 2019 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jl9549/9b9cd2ee1869ed0cb842f084ced578f2 to your computer and use it in GitHub Desktop.
Save Jl9549/9b9cd2ee1869ed0cb842f084ced578f2 to your computer and use it in GitHub Desktop.
void setup() {
Serial.begin(9600);
}
void loop() {
int sensor1 = analogRead(A0);
int sensor2 = analogRead(A1);
// int sensor3 = analogRead(A2);
// keep this format
Serial.print(sensor1);
Serial.print(","); // put comma between sensor values
Serial.print(sensor2);
// Serial.print(",");
// Serial.print(sensor3);
Serial.println(); // add linefeed after sending the last sensor value
// too fast communication might cause some latency in Processing
// this delay resolves the issue.
delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment