Skip to content

Instantly share code, notes, and snippets.

@dropmeaword
Created December 9, 2021 14:46
Show Gist options
  • Save dropmeaword/b47591f8bce266f3120a6659e21536cc to your computer and use it in GitHub Desktop.
Save dropmeaword/b47591f8bce266f3120a6659e21536cc to your computer and use it in GitHub Desktop.
#include <Arduino.h> // we only need this if we are in PlatformIO
void setup() {
// initialize serial communication
// over the USB wire back to our computer
Serial.begin( 9600 );
while(!Serial) ;
// define which pins in our sketch
// will be used as inputs and which as outputs
pinMode(A2, INPUT);
}
void loop() {
// read sensor value from pin
int reading = analogRead(A2);
// print it our as text over the serial wire so
// that we can see it on our monitor
Serial.print( reading );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment