error: expected unqualified-id before 'switch'

Am running into only one problem right now with my sketch..(error: expected unqualified-id before 'switch')...any ideas?Sketch is attached as it exceeds the character count.....ugh.

update.txt (29.5 KB)

You mean this one, outside of any function?

switch (mode) {

Good job we found that before the sketch got too large.

Yes that one.....as of right now when trying to compile it stops at the last part or the following code and highlights it.

   switch (mode) {
    //*********** Mode B Set Time***************************************************************
    case 101:{
    int minute, hour, second, date, month, year, tens, ones, key;
    int set_time = 0;
    while(set_time == 0){
    lcd.clear();
    hour = RTC.get(DS1307_HR,true); // This is in military time [0,23]
    minute = RTC.get(DS1307_MIN,false);
    second = RTC.get(DS1307_SEC,false);
    date = RTC.get(DS1307_DATE,false);
    month = RTC.get(DS1307_MTH,false);
    year = RTC.get(DS1307_YR,false);

    lcd.setCursor(0,0);
    lcd.print("Set time:");
    lcd.setCursor(1,10);
    if(hour < 10){
    lcd.print(" ");
    delay(keypad_delay);
    }
    lcd.print(hour);
    delay(keypad_delay);

So put it in a function.

Am lost....what do u mean by function?

I mean like "setup", "loop" "setLed".
Executable code in C has to be in a function - you can't just put a "switch" in mid-air and expect it to execute.

do like that :

void doMode(int mode) {

before : switch(mode) line

and call doMode(mode) in your setup or loop function as you need

That worked Grag38.....so then for each mode button that I have set up I would need to insert the (void doMode(int mode) {) & (doMode(mode))

so then for each mode button that I have set up I would need to insert the (void doMode(int mode) {) & (doMode(mode))

You just call it like you call any other of your functions, like "setLed" (that's a lot of parameters) or "bcdToDec"