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

    Compiler error in subroutine

    Scheduled Pinned Locked Moved Arduino
    1 Posts 1 Posters 2.6k Views
    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 Offline
      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

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post