#include <LiquidCrystal.h>
int rs=7, en=8, d4=9, d5=10, d6=11, d7=12;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
volatile int output = LOW;
int i=0;
void setup() {
// put your setup code here, to run once:
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print("Circuit Digest");
lcd.setCursor(0, 1);
lcd.print("Arduino Interrupt");
delay(3000);
lcd.clear();
pinMode(13, OUTPUT);
Serial.begin(9600);
attachInterrupt(digitalPinToInterrupt(2), button_pressed_1, RISING);
attachInterrupt(digitalPinToInterrupt(3), button_pressed_2, RISING);
}
void loop() {
// lcd.clear();
// lcd.print("Counter: ")
// lcd.print(i);
i++;
delay(1000);
digitalWrite(13, output); // Turn LED On or Off based on output
}
void button_pressed_1(){
output = LOW;
Serial.println("Interrupt 1");
// lcd.setCursor(0, 1);
// lcd.print("Interrupt 1");
}
void button_pressed_2(){
output = HIGH;
Serial.println("Interrupt 2");
// lcd.setCursor(0, 1);
// lcd.print("Interrupt 2");
}