🤖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

    Arduino
    1
    1
    456
    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
      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
      • First post
        Last post