"Error Compiling for Board Arduino/Genuino Uno" When I try to Run my Code

You can't define a function inside another function.
Move it out of loop()