Help with Project!

Hello! For one of my school projects I am using a push button to start a program that will play a tune from a piezo speaker while an LED lights up with the tune, and a seven segment display will show what note is being played. I have the speaker/LED part down, but I’m having trouble starting the program with the pushbutton and setting up the display. Thanks!

/* Arduino Project
November 26 2015 */

byte speaker = 12;
byte LED = 11;
byte ButtonPin = 13;

int C = 1047;
int D = 1175;
int E = 1319;
int F = 1397;
int G = 1568;
int A = 1760;
int B = 1976;

int Quarter = 200;
int Half = 450;
int Whole = 950;

void setup()
DDRD = B11111110; /*number display */
pinMode (speaker, OUTPUT);
pinMode (LED, OUTPUT);
pinMode (ButtonPin, INPUT);

int ScaleNotes = {E,E,E,E,E,E,E,G,C,D,E};
int NoteLengths = {Quarter, Quarter, Half, Quarter, Quarter, Half,
Quarter, Quarter, Quarter, Quarter, Whole};
for(int index = 0; index <11; index++)
note(ScaleNotes [index], NoteLengths[index]);

void loop()
void note(int frequency, int NoteDuration)
tone(speaker, frequency);
digitalWrite (LED, HIGH);
delay (NoteDuration);
noTone (speaker);
digitalWrite (LED,LOW);


Please read the "How to use this forum" sticky. Item #7 deals with how to post code.

Which 7-segment LED do you plan to use? Have you found any demo code for the display you plan to use?

The title of this thread is pretty meaningless. "Help with Project!" in "Project Guidance" forum doesn't provide any useful information about the sort of project you're working on. I personally think "Help" is very rarely (if ever) needed in a forum title. Most forum threads are started to request help so adding "help" to the title is redundant.

There is an Arduino Tutorial for both ... a) Push Buttons b) 7 Segment LED Display