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

    Creating and reading an INI file on the Cardputer's SD Card

    Scheduled Pinned Locked Moved Arduino
    1 Posts 1 Posters 1.4k 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.
    • A Offline
      AndrewDJohnson
      last edited by

      Hi Everyone!

      I have been having fun with the m5Cardputer, but am trying to create an INI file for Config settings.

      I want to use the mINI file class by metaYeti:

      https://github.com/metayeti/mINI

      So I've started with this code:

        mINI::INIFile file("myfile.ini");
        mINI::INIStructure ini;
        //file.read(ini);
         ini["section"]["key"] = "value adj"; 
         file.generate(ini);
         Serial.printf ("Ini section is %s\n",ini.get("section").get("key").c_str());
        //file.write(ini); 
        Serial.printf ("Tried to write INI to SD card.\n");
      

      This all compiles and runs - but of course, it doesn't do anything. What baffles me is where the INI file would be created - as there is no path or filesystem set in the example above. I have a feeling I need to do something with a filestream class or something - and somehow make this stream connect with the SD filesystem object or something.

      The object is clearly being created - because I can print out the value I set (as shown above).

      So can anyone tell me how this can be actually linked to an actual inifile stored in an actual folder!?!

      Thanks!

      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