// DEKLARASI
//A022008_Enrico William A. Sihotang
long int rico = 0;
int LED = 10;
void setup() {
pinMode(LED, OUTPUT);
digitalWrite(LED, LOW);
pinMode(2, INPUT);
attachInterrupt(digitalPinToInterrupt(2), Menghitung, RISING);
Serial.begin(9600);
}
void loop () {
rico = rico++;
digitalWrite(LED, HIGH);
delay(1000);
digitalWrite(LED, LOW);
delay(1000);
Serial.print("Hitungan Sekarang = ");
Serial.println(rico);
Serial.println(digitalRead(2));
}
void Menghitung() {
rico++;
}