int LED1=4;
int LED2=5;
int LED4=6;
int LED8=7;
int Sebentar=500;
int Lama=1500;
int ReadPin=A5;
int ReadVal;
float V2;
void setup() {
// put your setup code here, to run once:
pinMode (7,OUTPUT);
pinMode (6,OUTPUT);
pinMode (5,OUTPUT);
pinMode (4,OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
// 1 below
ReadVal=analogRead(ReadPin);
V2=(5./1023.)*ReadVal;
Serial.println(V2);
digitalWrite(LED8, LOW);digitalWrite(LED4, LOW);digitalWrite(LED2, LOW);digitalWrite(LED1, HIGH);
delay(Lama); // 2 below
ReadVal=analogRead(ReadPin);
V2=(5./1023.)*ReadVal;
Serial.println(V2);
digitalWrite(LED8, LOW);digitalWrite(LED4, LOW);digitalWrite(LED2, HIGH);digitalWrite(LED1, LOW);
delay(Lama); // 3 below
ReadVal=analogRead(ReadPin);
V2=(5./1023.)*ReadVal;
Serial.println(V2);
digitalWrite(LED8, LOW);digitalWrite(LED4, LOW);digitalWrite(LED2, HIGH);digitalWrite(LED1, HIGH);
delay(Lama); // 4 below
ReadVal=analogRead(ReadPin);
V2=(5./1023.)*ReadVal;
Serial.println(V2);
digitalWrite(LED8, LOW);digitalWrite(LED4, HIGH);digitalWrite(LED2, LOW);digitalWrite(LED1, LOW);
delay(Lama); // 5 below
digitalWrite(LED8, LOW);digitalWrite(LED4, HIGH);digitalWrite(LED2, LOW);digitalWrite(LED1, HIGH);
delay(Lama); // 6 below
ReadVal=analogRead(ReadPin);
V2=(5./1023.)*ReadVal;
Serial.println(V2);
digitalWrite(LED8, LOW);digitalWrite(LED4, HIGH);digitalWrite(LED2, HIGH);digitalWrite(LED1, LOW);
delay(Lama); // 7 below
ReadVal=analogRead(ReadPin);
V2=(5./1023.)*ReadVal;
Serial.println(V2);
digitalWrite(LED8, LOW);digitalWrite(LED4, HIGH);digitalWrite(LED2, HIGH);digitalWrite(LED1, HIGH);
delay(Lama); // 8 below
digitalWrite(LED8, HIGH);digitalWrite(LED4, LOW);digitalWrite(LED2, LOW);digitalWrite(LED1, LOW);
delay(Lama); // 9 below
digitalWrite(LED8, HIGH);digitalWrite(LED4, LOW);digitalWrite(LED2, LOW);digitalWrite(LED1, HIGH);
delay(Lama); // 10 below
digitalWrite(LED8, HIGH);digitalWrite(LED4, LOW);digitalWrite(LED2, HIGH);digitalWrite(LED1, LOW);
delay(Lama); // 11 below
digitalWrite(LED8, HIGH);digitalWrite(LED4, LOW);digitalWrite(LED2, HIGH);digitalWrite(LED1, HIGH);
delay(Lama); // 12 below
digitalWrite(LED8, HIGH);digitalWrite(LED4, HIGH);digitalWrite(LED2, LOW);digitalWrite(LED1, LOW);
delay(Lama); // 13 below
digitalWrite(LED8, HIGH);digitalWrite(LED4, HIGH);digitalWrite(LED2, LOW);digitalWrite(LED1, HIGH);
delay(Lama); // 14 below
digitalWrite(LED8, HIGH);digitalWrite(LED4, HIGH);digitalWrite(LED2, HIGH);digitalWrite(LED1, LOW);
delay(Lama); // 15 below
digitalWrite(LED8, HIGH);digitalWrite(LED4, HIGH);digitalWrite(LED2, HIGH);digitalWrite(LED1, HIGH);
delay(Lama);
}