expected initializer before 'elapsedMillis'

Hello getting this message and cant seem to see why, this is my first sketch so its kinda got huge for me to find all the little things wrong, any help would be epic!!!

Arduino: 1.8.5 (Mac OS X), Board: “Arduino/Genuino Uno”

button_clean_version:8: error: expected initializer before ‘elapsedMillis’
elapsedMillis timeElapsed; //pin not stated ?? pin 8?
^
/Users/aprier/Documents/Arduino/button_clean_version/button_clean_version.ino: In function ‘void loop()’:
button_clean_version:40: error: ‘timeElapsed’ was not declared in this scope
timeElapsed = 0;
^
exit status 1
expected initializer before ‘elapsedMillis’

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

here is my code.

any help would be great not sure what to do next.

Thank you so much for any help!

button_clean_version.ino (3.63 KB)

int val                     // not sure what this does or the other one?

whoopsie!

int val = 0;                 //val is used to store state of input pin for photoresitor or the other one?
int val                     // not sure what this does or the other one?

double whoopsie!

Hello, so should i get rid of them?
the code does use them in it, so i am curious how to get to the next step.

Thanks

well, you can only have one global variable called val so there is that to consider.

I'd take a stab at removing the 2nd one, the one missing the semicolon. :wink:

it works thank you!, you guys rock