Programming LCD to read RPM

So I have the bread board, motor, sensor, and Arduino Uno all hooked up correctly as far as I know. My issue is that I keep getting an error signal within my code that reads

/tmp/937588881/sketch_apr24b/sketch_apr24b.ino:162:22: error: ‘CircuitMagic’ was not declared in this scope

/tmp/937588881/sketch_apr24b/sketch_apr24b.ino:163:24: error: ‘BLACK’ was not declared in this scope

exit status 1

I guess I’m not entirely certain how to define the scope within my code and keep the service happy enough to allow me to upload it to my board. My Code will be below, and thoughts? PS for ease of finding the line with the issue I filled before and after the code with x’s

/*
Sketch 2 - Optical Sensor

Motor tachometer

*/
#include <LiquidCrystal.h>

// init liquidcrystal
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int switchPin = 6;
int switchState = 0;
int prevSwitchState = 0;
int reply;

//——code for RPM—————-
int encoder_pin = 2;

// The pin the encoder is connected
unsigned int rpm;

// rpm reading
volatile byte pulses;

// number of pulses
unsigned long timeold = millis();

// The number of pulses per revolution
// depends on your index disc!!
unsigned int pulsesperturn = 1;

void counter() {
// update the count
pulses++;
}

void setup() {
// setting up the baud rate
Serial.begin(9600);

// Setting up the LCD to display message of completion
lcd.begin(16, 2);

//Setup Channel A
pinMode(12, OUTPUT); // Initiates Motor Channel A pin
pinMode(13, OUTPUT); // Initiates Motor Channel B pin

pinMode(9, OUTPUT); // Initiates Brake Channel A pin
pinMode(8, OUTPUT); // Initiates Brake Channel B pin
}

void loop() {
unsigned long currentmillis = millis();
if (currentmillis - timeold >= 1000) {
/Uptade every one second, this will be equal to reading frecuency (Hz)./
//Don’t process interrupts during calculations
detachInterrupt(0);

//forward @ full speed
digitalWrite(12, HIGH); //Establishes forward direction of Channel A
digitalWrite(13, HIGH); // forward dirrection of Channel B
digitalWrite(9, LOW); //Disengage the Brake for Channel A
digitalWrite(8, LOW); //Disengage the Brake for Channel B

analogWrite(3, 255); //Spins the motor on Channel A at full speed
analogWrite(11, 255); //Spins the motor on channel B at full speed

delay(2000); // run for seconds
}
}

//——code for RPM—————-
int encoder_pin = 2;
// The pin the encoder is connected
unsigned int rpm;
// rpm reading
volatile byte pulses;
// number of pulses
unsigned long timeold;
// The number of pulses per revolution
// depends on your index disc!!
unsigned int pulsesperturn = 1;
void counter()
{
//Update count
pulses++;
}
//———————————–
void setup() {
Serial.begin(9600);
// by default, we’ll generate the high voltage from the 3.3v line internally! (neat!)
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
// initialize with the I2C addr 0x3D (for the 128×64)
// init done
// Show image buffer on the display hardware.
// Since the buffer is intialized with an Adafruit splashscreen
// internally, this will display the splashscreen.
//display.display();
//delay(2000);
// Clear the buffer.
//display.clearDisplay();
// draw a single pixel
//display.drawPixel(10, 10, WHITE);
// Show the display buffer on the hardware.
// NOTE: You must call display after making any drawing commands
// to make them visible on the display hardware!
//display.display();
//delay(2000);
//———–code for RPM—————
//Use statusPin to flash along with interrupts
pinMode(encoder_pin, INPUT);
//Interrupt 0 is digital pin 2, so that is where the IR detector is connected
//Triggers on FALLING (change from HIGH to LOW)
attachInterrupt(0, counter, FALLING);
// Initialize
pulses = 0;
rpm = 0;
timeold = 0;
}
void loop()
{
xxxxxxxxxxx if (millis() – timeold >= 1000) {[/color][/i][/b]xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
/Uptade every one second, this will be equal to reading frecuency (Hz)./
//Don’t process interrupts during calculations
detachInterrupt(0);
//Note that this would be 60*1000/(millis() – timeold)*pulses if the interrupt
//happened once per revolution
rpm = (60 * 1000 / pulsesperturn ) / (millis() – timeold) * pulses;
timeold = millis();
pulses = 0;
//Write it out to serial port
Serial.print(“RPM = “);
Serial.println(rpm, DEC);
updateDisplay(rpm);
//Restart the interrupt processing
attachInterrupt(0, counter, FALLING);
}
}
int valLen;
int displayWidth = 128;
int letterWidth = 18;
void updateDisplay(int rpm) {
if (rpm > 9999)
valLen = 5;
else if (rpm > 999)
valLen = 4;
else if (rpm > 99)
valLen = 3;
else if (rpm > 9)
valLen = 2;
else
valLen = 1;
//————-update display————
display.clearDisplay();
// text display tests
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(30, 0);
display.println(“CircuitMagic”);
display.setTextColor(BLACK, WHITE);
// ‘inverted’ text
//display.println(3.141592);
display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(45, 20);
display.println(“RPM”);
display.setCursor((displayWidth / 2) - (letterWidth / 2 * valLen), 42);
display.setTextSize(3);
display.println(rpm);
// display.println(0xDEADBEEF, HEX);
display.display();
//———————-
}

It looks to me like you’ve got code that isn’t in a function.
Please remember to use code tags when posting code.

Edit: How many loop functions do you have?
How many setup functions do you have?

How many should you have?

Besides the code complaints, you also have some pin usage duplications:

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int encoder_pin = 2;
pinMode(12, OUTPUT); // Initiates Motor Channel A pin
analogWrite(3, 255); //Spins the motor on Channel A at full speed
analogWrite(11, 255); //Spins the motor on channel B at full speed