Issues combining light code with tone keyboard

I have been trying to combine a light code with this tone keyboard so that when the button is pressed, sound and light are produced. A different LED for the different buttons. this is the code i have now, and its just for the tone KB, please how to i combine the LED section to this?
/*
Keyboard

Plays a pitch that changes based on a changing
input circuit:

  • 3 pushbuttons from +5V to analog in 0 through
    3
  • 3 10K resistors from analog in 0 through 3 to
    ground
  • 8-ohm speaker on digital pin 8
    */

int pos = 0;

void setup()
{
pinMode(A0, INPUT);
pinMode(8, OUTPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
}

void loop()
{
// if button press on A0 is detected
if (digitalRead(A0) == HIGH) {
tone(8, 440, 100); // play tone 57 (A4 = 440 Hz)
}
// if button press on A1 is detected
if (digitalRead(A1) == HIGH) {
tone(8, 494, 100); // play tone 59 (B4 = 494 Hz)
}
// if button press on A0 is detected
if (digitalRead(A2) == HIGH) {
tone(8, 523, 100); // play tone 60 (C5 = 523 Hz)
}
delay(10); // Delay a little bit to improve simulation performance
}

You haven't shown the light code so the best I can do is to point you to pages about merging codes.

https://arduino-info.wikispaces.com/CombiningArduinoSketches

http://www.thebox.myzen.co.uk/Tutorial/Merging_Code.html

void setup()
{
pinMode(13, OUTPUT);
}

void loop()
{
digitalWrite(13, HIGH);
delay(1000); // Wait for 1000 millisecond(s)
digitalWrite(13, LOW);
delay(1000); // Wait for 1000 millisecond(s)
}

This is the code for the light sequence, sorry forgot to add

Have you tried turning on a LED when you detect that a button becomes pressed ?

Have you tried turning on a LED when you detect that a button becomes pressed ?

Of course, with those useless delay()s, make sure you press the switch long enough.

PaulS:
Of course, with those useless delay()s, make sure you press the switch long enough.

Small steps Paul.

You may want to jump in and solve all of the problems at once but I don't think the OP is ready for that. I am sure that we can see plenty of problems coming down the line if delay() is used but let's deal with them as they arise.

UKHeliBob:
Small steps Paul.

You may want to jump in and solve all of the problems at once but I don't think the OP is ready for that. I am sure that we can see plenty of problems coming down the line if delay() is used but let's deal with them as they arise.

I totally agree. I just want OP to be aware of the fact that the direction he is moving while painting the floor is not the direction where the door is.