Skip to content

Instantly share code, notes, and snippets.

Created April 10, 2017 16:51
Show Gist options
  • Save anonymous/8d0389b5af0e7a2d1095c0a940950d40 to your computer and use it in GitHub Desktop.
Save anonymous/8d0389b5af0e7a2d1095c0a940950d40 to your computer and use it in GitHub Desktop.
// create instances of the sensors
int sensor1;
int sensor2;
int sensor3;
char val;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println('0');
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial.available() > 0){
char input = Serial.read();
val = Serial.read();
// input from potentiometers
sensor1 = analogRead(A0);
sensor2 = analogRead(A1);
sensor3 = analogRead(A2);
// print out the lines of the potentiometers divided by 4 to get a value from 0-255
Serial.print(sensor1/4);
Serial.print(",");
Serial.print(sensor2/4);
Serial.print(",");
Serial.println(sensor3/4);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment