const int pinSensor = A0;
#define LED_RED 10
#define LED_GREEN 9
#define LED_BLUE 8
int adcValue;
int hitung, X, Y, Z;
void setup()
{
Serial.begin(115200);
pinMode(pinSensor, INPUT);
pinMode(LED_BLUE,OUTPUT);
pinMode(LED_GREEN,OUTPUT);
pinMode(LED_RED,OUTPUT);
digitalWrite(LED_BLUE,LOW); //BLUE
digitalWrite(LED_GREEN,LOW); //GREEN
digitalWrite(LED_RED,LOW); //RED
hitung=0;
X=10;
Y=20;
Z=30;
}
void loop()
{
X=0; //ekspresi1
while(X<5)
{
digitalWrite(LED_RED,HIGH);
digitalWrite(LED_GREEN,LOW);
digitalWrite(LED_BLUE,LOW);
delay(1000);
X++;
Serial.print(X);
Y=0; //ekspresi1
while((X<5)&&(Y<5))
{
digitalWrite(LED_RED,LOW);
digitalWrite(LED_GREEN,LOW);
digitalWrite(LED_BLUE,HIGH);
delay(1000);
Y++;
Serial.print(Y);
}
}
}