Skip to content

Instantly share code, notes, and snippets.

@antonprafanto
Last active September 19, 2024 06:34
Show Gist options
  • Select an option

  • Save antonprafanto/72d717c6d2916927da8918466f3ea77c to your computer and use it in GitHub Desktop.

Select an option

Save antonprafanto/72d717c6d2916927da8918466f3ea77c to your computer and use it in GitHub Desktop.
const int potPin = 7; // Potentiometer terhubung ke GPIO 7 (Analog ADC1_CH6)
// Variabel untuk menyimpan nilai potensiometer
int potValue = 0;
void setup() {
Serial.begin(115200);
delay(1000);
}
void loop() {
// Membaca nilai potensiometer
potValue = analogRead(potPin);
Serial.println(potValue);
delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment