Skip to content

Instantly share code, notes, and snippets.

@vinirodr
Created May 2, 2016 08:17
Show Gist options
  • Save vinirodr/457ea07165ab667a01424be1b1cb3211 to your computer and use it in GitHub Desktop.
Save vinirodr/457ea07165ab667a01424be1b1cb3211 to your computer and use it in GitHub Desktop.
//this outputs pot value to screen in ohms
int gasSensor = 0; // select input pin for gasSensor
int val = 0; // variable to store the value coming from the sensor
void setup() {
Serial.begin(9600);
}
void loop() {
val = analogRead(gasSensor); // read the value from the pot
Serial.println( val );
delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment