[Beginner] C File to INO

Hi guys I need help. I have this project, electronic metronome, that uses a atmega328 and a 7 segment display to show the beats per minute. I got this c file from (http://www.instructables.com/id/Electronic-Metronome/) but when i try to upload it on the Arduino IDE, it shows error. Can anyone help me translate this c file into .ino?

Note:
I just bought my own arduino uno and I assure you that I will use it for further projects (as a hobby). I just need this finished today for a final project. I took C classes before and that's it. Please help me. Thank you for your kind support.

Metronome_v1.c (16.5 KB)

aaagemo:
but when i try to upload it on the Arduino IDE, it shows error.

Would you care to tell us what the error is? Post the full error message.

Thank you for your response! Here is the error message

sketch_may24b\sketch_may24b.ino:33:0: warning: "F_CPU" redefined

 #define F_CPU 1000000UL

 ^

<command-line>:0:0: note: this is the location of the previous definition

sketch_may24b.ino:51:0: warning: "INPUT" redefined

 #define INPUT                  PINB  //Buttons are on PB2-PB4

 ^

In file included from sketch\sketch_may24b.ino.cpp:1:0:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:43:0: note: this is the location of the previous definition

 #define INPUT 0x0

 ^

OK, yeah you might want to remove the F_CPU line. That is defined in the core and you want the value defined there unless you are not running your board at the normal speed. What type of Arduino are we talking about?

And you probably shouldn't redefine INPUT. Just change that identifier to something else, like INPUT_PIN maybe. Be sure to change it everywhere in the code that it is used.

I'm using arduino uno rev3.

Thank you so much for the help Delta_G!!! It's compiling without errors now. Thank you!!!

aaagemo:
I'm using arduino uno rev3.

OK, then you definitely want to use the F_CPU defined in the core and not the one from that code.

Glad you got it going.