#include<LiquidCrystal.h>
LiquidCrystal lcd (7,8,9,10,11,12);

int ledPin1 = 13;
int ledPin2 = 1;
int ledPin3 = 4;

int intPin1 = 2;
int intPin2 = 3;

int i=0;

volatile byte output1 = HIGH;
volatile byte output2 = HIGH;



void buttonPressed1()
{
  output1 = HIGH;
  output2 = LOW;
}

void buttonPressed2()
{
  output2 = HIGH;
  output1 = LOW;
}


void setup() {

noInterrupts();
  
lcd.begin(16, 2);

lcd.setCursor(0,0);
//PRINT MSG TO THE LCD
lcd.print("COUNTER: 1325");
lcd.write(byte(0));

pinMode(ledPin3, OUTPUT);
pinMode(13,OUTPUT);
pinMode(1,OUTPUT);
attachInterrupt(digitalPinToInterrupt(intPin1),buttonPressed1,RISING);
attachInterrupt(digitalPinToInterrupt(intPin2),buttonPressed2,RISING);

interrupts();


}


void loop() {
  
  lcd.setCursor(7,1);
  lcd.print(i);
  if(i<900) i++;
  else (i=0);


  digitalWrite(ledPin1,output1);
  digitalWrite(ledPin2,output2);
  
  
  
}
