I can figure out what is wrong with this simple sketch

Ok thanks so all declarations need to be done outside of setup and loop then?