Created
December 9, 2021 14:46
-
-
Save dropmeaword/b47591f8bce266f3120a6659e21536cc to your computer and use it in GitHub Desktop.
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
#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