This commit is contained in:
Marcus 2024-10-17 02:40:32 +02:00
parent c4155e1f9b
commit 7b43171231
2 changed files with 50 additions and 4 deletions

View file

@ -108,9 +108,9 @@ void setup() {
Serial.println(":: initialise LittleFS ::");
if(LittleFS.begin()) {
Serial.println(":: LittleFS successfully initialised ::");
Serial.println(":: LittleFS: successfully initialised");
} else {
Serial.println("!! LittleFS failed initialising !!");
Serial.println("!! LittleFS: failed initialising !!");
}
// read the configfile from LittleFS
@ -119,14 +119,14 @@ void setup() {
Serial.println("!! LittleFS: config.json not found, creating it !!");
lfs_configfile = LittleFS.open(configfile, "w");
if(lfs_configfile) {
Serial.println(":: LittleFS: config.json successfully created ::");
Serial.println(":: LittleFS: config.json successfully created");
// write into the file
lfs_configfile.print("{test: }");
// close the file
lfs_configfile.close();
}
} else {
Serial.println(":: LittleFS: config.json successfully opened ::");
Serial.println(":: LittleFS: config.json successfully opened");
String configfile_content = "";
while (lfs_configfile.available()) {

View file

@ -0,0 +1,46 @@
/*
*
* include/CanGrow.h - core stuff header file
*
*
* MIT License
*
* Copyright (c) 2024 DeltaLima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
// blink fast with the built in LED in an infinite loop
void Panic() {
byte i = 0;
while(true) {
if(i % 2) {
digitalWrite(PinWIPE, LOW);
} else {
digitalWrite(PinWIPE, HIGH);
}
i++;
delay(125);
}
}