🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Compiler error in subroutine

    Arduino
    1
    1
    2.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • teddygagT
      teddygag
      last edited by

      void getSaying(int x)
      { M5.Lcd.setCursor(0, 80);
      switch (x) {
      case 1:
      M5.Lcd.println(1);
      break;
      case 2:
      M5.Lcd.println(2);
      break;
      case 3:
      M5.Lcd.println(3);
      break;
      case 4:
      M5.Lcd.println(4);
      break;
      case 5:
      M5.Lcd.println(5);
      break;
      case 6:
      M5.Lcd.println(6);
      break;
      case 7:
      M5.Lcd.println(7);
      break;
      case 8:
      M5.Lcd.println(8);
      break;
      case 9:
      M5.Lcd.println(9);
      break;
      case 10:
      M5.Lcd.println(10);
      break;
      case 11:
      M5.Lcd.println(11);
      break;
      case 12:
      M5.Lcd.println(12);
      break;
      case 13:
      M5.Lcd.println(13);
      break;
      case 14:
      M5.Lcd.println(14);
      break;
      case 15:
      M5.Lcd.println(15);
      break;
      case 16:
      M5.Lcd.println(16);
      break;
      case 17:
      M5.Lcd.println(17);
      break;
      default:
      M5.Lcd.println("No String Found X="+x);
      break;
      }
      return;
      }
      <---------Program will not compile, line is highlighted after the last bracket
      error is 'expected declaration before '}' token'

      1 Reply Last reply Reply Quote 0
      • First post
        Last post