int lm = 2; // pin led
int lk = 3;
int lh = 4;
int potensio = A5; // pin potensio
void setup() { // fungsi untuk setup utama
Serial.begin(9600); // kecepatan memproses data
pinMode(lm, OUTPUT);
pinMode(lk, OUTPUT);
pinMode(lh, OUTPUT);
pinMode(potensio, INPUT);
}
void loop() { // fungsi untuk perulangan lampu led
int nilaipotensio = analogRead(potensio);
Serial.println(nilaipotensio);
digitalWrite(lm, 1);
digitalWrite(lk, 0);
digitalWrite(lh, 0);
delay(nilaipotensio);
digitalWrite(lm, 0);
digitalWrite(lk, 1);
digitalWrite(lh, 0);
delay(nilaipotensio);
digitalWrite(lm, 0);
digitalWrite(lk, 0);
digitalWrite(lh, 1);
delay(nilaipotensio);
}