IOT ValueSelector and ENUM

I'm attempting to use ENUM to develop a set of switch-cases:

enum MODE {
ON,
OFF,
STANDBY};

MODE mode;

I'd like to use MODE in an IOT project with a read/write VALUE SELECTOR. However, I get errors when I attempt to update "mode" based on changes from the MODE (value) in the dashboard:

void onIotMODEStateChange() {mode = iot_MODESTATE};

Is there limitations with using ENUM in the IOT, or am I missing something?

Hi @bwinter. I'm going to ask you to provide more information so that we can assist you.

Sketch Code

Please post your full sketch.

I'll provide instructions you can follow to do that:

  1. If you are not already, log in to your Arduino account:
    https://login.arduino.cc/login
  2. Click the following link to open the list of your Arduino Cloud Things in the web browser:
    https://app.arduino.cc/things
  3. Click on the Thing you are referring to in your post.
    The Thing's "Setup" page will open.
  4. Click the "Sketch" tab at the top of the page.
    The Thing's "Sketch" page will open.
  5. Click the "Auto indent" button on the toolbar:

    This is done to make the code easier for us to read.
  6. Click on the editor panel of the window.
  7. Press the Ctrl+A keyboard shortcut (Command+A for macOS users).
    This will select all the code.
  8. Press the Ctrl+C keyboard shortcut (Command+C for macOS users).
    This will copy the selected text to the clipboard.
  9. Open a forum reply here by clicking the "Reply" button.
  10. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
  11. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the copied code into the code block.
  12. Move the cursor outside of the code block markup before you add any additional text to your reply.
  13. Click the "Reply" button to post the output.

If your code uses a library that you imported to your Arduino Cloud account (as opposed to the standard libraries that are pre-installed), please post a link to where you downloaded that imported library from.

Information re: "Errors"

Please provide the full and exact text of the error messages.

Where do you see the errors?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.