From 7b43171231e3ec569b0e933f9e6fa250ecaefa9b Mon Sep 17 00:00:00 2001 From: Marcus Date: Thu, 17 Oct 2024 02:40:32 +0200 Subject: [PATCH] wip --- Arduino/CanGrow/CanGrow.ino | 8 ++--- Arduino/CanGrow/include/CanGrow_Core.h | 46 ++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 Arduino/CanGrow/include/CanGrow_Core.h diff --git a/Arduino/CanGrow/CanGrow.ino b/Arduino/CanGrow/CanGrow.ino index 386956e..d126f5b 100644 --- a/Arduino/CanGrow/CanGrow.ino +++ b/Arduino/CanGrow/CanGrow.ino @@ -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()) { diff --git a/Arduino/CanGrow/include/CanGrow_Core.h b/Arduino/CanGrow/include/CanGrow_Core.h new file mode 100644 index 0000000..157b659 --- /dev/null +++ b/Arduino/CanGrow/include/CanGrow_Core.h @@ -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); + } + +} +