Skip to content

Format file cfg.txt #3

@AlexArGC

Description

@AlexArGC

Thanks for the work! I would like to add a description to your library.

  1. The cfg.txt file must be in UNIX format (ANSI encoding). This is especially true for all Windows users! Line break (LR) should be 0x0A and nothing more.

  2. There was a question about the Progress bar. It's possible! Because the Updater.cpp library already has a callback function.
    For example, create your own callback function (here using serial and LCD):

void OnProgress(int progress, int totalt)
{
   static int last = 0;
   int progressPercent = (100 * progress) / totalt;
   Serial.print(".");
   if (last != progressPercent && progressPercent % 5 == 0)
   {
     // print to 5%
     Serial.println(progressPercent);
     lcd.setCursor(progressPercent / 5 - 1, 2);
     lcd.print(char(255));
   }
   last = progressPercent;
}

And before running updater.CheckAndUpdate(); run the code:

// set update callback function
Update.onProgress(OnProgress);
updater.CheckAndUpdate();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions