Encoder menu help!!! im stuck

So this is what I am trying to use here but I cannot compile while im getting the following error messages. any help is appreciated.

// Include Standard Library

#include <stdlib.h>

// Include LCD Library Code

#include <LiquidCrystal.h>

// Include Rotary Encoder Library
#include <QuadEncoder.h>

#include <Button.h>

// control

#define ROTENCA 43

#define ROTENCB 45

#define BUTTONR 2 // Intr 0 = Pin 2

#define BUTTON 1 // Intr 1 = Pin 3

// modes

#define MODE_DISPLAY 0

#define MODE_COUNT 1

#define LAST_MODE 1

// initialize the LCD with the numbers of the interface pins

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// initialize the encoder

QuadEncoder encoder(ROTENCA,ROTENCB); // initialize the encoder

// has the encoder moved on this loop?

boolean moved = false;

Button buttonR(BUTTONR);

// other vars

int mode = MODE_DISPLAY;

int count = 0;

unsigned long timeSinceLastDisplay = 0;

void setup() {

// setup interrupts

attachInterrupt(BUTTON, displayMenu, RISING);

// set the LCD’s number of cols and lines

lcd.begin(16, 2);

// print a welcome message

lcd.clear();

lcd.print(" WELCOME! ");

lcd.setCursor(0,1);

lcd.print(“Initializing”);

void loop()

displayMenu() {

int selected = 3;

lcd.clear();

lcd.setCursor(0,0);

lcd.print(“Turn the knob to”);

lcd.setCursor(0,1);

lcd.print(“select an option”);

while (!buttonR.pressed()) {

selected += readEncoder();

if (selected<0) selected=3;

if (selected>3) selected=0;

if (moved) {

lcd.clear();

lcd.setCursor(0,0);

switch(selected) {

case 0:

lcd.print("Change Units ");

break;

case 1:

lcd.print(“Backlight On/Off”);

break;

case 2:

lcd.print("Logging On/Off ");

break;

case 3:

lcd.print("Exit Settings ");

break;

}

}

}

// when button is pressed…

lcd.clear();

switch(selected) {

case 0:

settingsChangeUnits();

break;

case 1:

settingsChangeBacklight();

break;

case 2:

settingsChangeLogging();

}

}

void settingsChangeUnits() {

int selected = 2;

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Select Unit ");

lcd.setCursor(0,1);

lcd.print("Currently it’s ");

lcd.write();

while (!buttonR.pressed()) {

selected += readEncoder();

if (selected<0) selected=2;

if (selected>2) selected=0;

if (moved) {

lcd.setCursor(0,1);

switch(selected) {

case 0:

lcd.print("Celcius ");

break;

case 1:

lcd.print("Fahrenheit ");

break;

case 2:

lcd.print("Cancel ");

break;

}

}

}
j…

switch(selected) {

case 0:

temperatureUnit = ‘C’;

break;

case 1:

temperatureUnit = ‘F’;

break;

}

}

// returns 1 for right, -1 for left, or 0 for no movement

int readEncoder() {

moved = true;

switch(encoder.hb()) {

case ‘>’: return 1;

case ‘<’: return -1;

}

moved = false;

return 0;

}

I am getting the following errors.

temp_menu_test_test_test.ino: In function ‘void setup()’:
temp_menu_test_test_test:133: error: a function-definition is not allowed here before ‘{’ token
temp_menu_test_test_test:148: error: a function-definition is not allowed here before ‘{’ token
temp_menu_test_test_test:461: error: expected `}’ at end of input

You appear to have missed the closing curly brace at the end of your setup function.

--best, Michael