Error expected '}' at end of input

This goes at the top of your sketch, you have it in loop():
#include "Arduino.h"

Always use code tags when showing your sketch to us.
use the </> icon in the posting menu.

.