Skip to content

Instantly share code, notes, and snippets.

@hax0kartik
Created October 15, 2021 04:07
Show Gist options
  • Save hax0kartik/b0454aec948d319a1f274cc8cb52bbb5 to your computer and use it in GitHub Desktop.
Save hax0kartik/b0454aec948d319a1f274cc8cb52bbb5 to your computer and use it in GitHub Desktop.
/* This function runs once */
void setup()
{
/* initialize serial communication at 9600 bits per second */
Serial.begin(9600);
}
/* This function runs over and over*/
void loop()
{
/* Read the sensor value from the potentiometer connected to A0. 0-1023 */
int sensorValue = analogRead(A0);
/* Print the sensor values on serial */
Serial.println(sensorValue);
/* Delay a bit for stability */
delay(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment