Browse Source

add 08

master
Jakub Škrabánek 2 months ago
parent
commit
591235ca7e
  1. 5
      08_ulozny_prostor_littlefs/.gitignore
  2. 10
      08_ulozny_prostor_littlefs/.vscode/extensions.json
  3. 1
      08_ulozny_prostor_littlefs/data/text.txt
  4. 16
      08_ulozny_prostor_littlefs/platformio.ini
  5. 24
      08_ulozny_prostor_littlefs/src/main.cpp
  6. 11
      08_ulozny_prostor_littlefs/test/README
  7. 5
      08_ulozny_prostor_spiffs/.gitignore
  8. 10
      08_ulozny_prostor_spiffs/.vscode/extensions.json
  9. 1
      08_ulozny_prostor_spiffs/data/text.txt
  10. 15
      08_ulozny_prostor_spiffs/platformio.ini
  11. 24
      08_ulozny_prostor_spiffs/src/main.cpp
  12. 11
      08_ulozny_prostor_spiffs/test/README
  13. 1
      zzz_test_littlefs/data/inputFloat.txt
  14. 1
      zzz_test_littlefs/data/inputInt.txt
  15. 1
      zzz_test_littlefs/data/inputString.txt
  16. 1
      zzz_test_littlefs/src/main.cpp

5
08_ulozny_prostor_littlefs/.gitignore

@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch

10
08_ulozny_prostor_littlefs/.vscode/extensions.json

@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}

1
08_ulozny_prostor_littlefs/data/text.txt

@ -0,0 +1 @@
Hello world! from text.txt

16
08_ulozny_prostor_littlefs/platformio.ini

@ -0,0 +1,16 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
board_build.filesystem = littlefs

24
08_ulozny_prostor_littlefs/src/main.cpp

@ -0,0 +1,24 @@
#include <Arduino.h>
#include "LittleFS.h"
void setup() {
Serial.begin(115200);
if(!LittleFS.begin(true)){
Serial.println("Chyba při zavádění (mounting) LittleFS");
return;
}
File soubor = LittleFS.open("/text.txt");
if(!soubor) {
Serial.println("Chyba pri otevirani souboru");
return;
}
Serial.println("obsah souboru:");
while (soubor.available()){
Serial.write(soubor.read());
}
Serial.println("");
soubor.close();
}
void loop() {
}

11
08_ulozny_prostor_littlefs/test/README

@ -0,0 +1,11 @@
This directory is intended for PlatformIO Test Runner and project tests.
Unit Testing is a software testing method by which individual units of
source code, sets of one or more MCU program modules together with associated
control data, usage procedures, and operating procedures, are tested to
determine whether they are fit for use. Unit testing finds problems early
in the development cycle.
More information about PlatformIO Unit Testing:
- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html

5
08_ulozny_prostor_spiffs/.gitignore

@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch

10
08_ulozny_prostor_spiffs/.vscode/extensions.json

@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}

1
08_ulozny_prostor_spiffs/data/text.txt

@ -0,0 +1 @@
Ahoj Svete! z text.txt

15
08_ulozny_prostor_spiffs/platformio.ini

@ -0,0 +1,15 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200

24
08_ulozny_prostor_spiffs/src/main.cpp

@ -0,0 +1,24 @@
#include <Arduino.h>
#include "SPIFFS.h"
void setup() {
Serial.begin(115200);
if(!SPIFFS.begin(true)){
Serial.println("Chyba při zavádění (mounting) SPIFFS");
return;
}
File soubor = SPIFFS.open("/text.txt");
if(!soubor) {
Serial.println("Chyba pri otevirani souboru");
return;
}
Serial.println("obsah souboru:");
while (soubor.available()){
Serial.write(soubor.read());
}
Serial.println("");
soubor.close();
}
void loop() {
}

11
08_ulozny_prostor_spiffs/test/README

@ -0,0 +1,11 @@
This directory is intended for PlatformIO Test Runner and project tests.
Unit Testing is a software testing method by which individual units of
source code, sets of one or more MCU program modules together with associated
control data, usage procedures, and operating procedures, are tested to
determine whether they are fit for use. Unit testing finds problems early
in the development cycle.
More information about PlatformIO Unit Testing:
- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html

1
zzz_test_littlefs/data/inputFloat.txt

@ -0,0 +1 @@
3.14

1
zzz_test_littlefs/data/inputInt.txt

@ -0,0 +1 @@
123

1
zzz_test_littlefs/data/inputString.txt

@ -0,0 +1 @@
Test souboru

1
zzz_test_littlefs/src/main.cpp

@ -175,5 +175,6 @@ void loop() {
float yourInputFloat = readFile(LittleFS, "/inputFloat.txt").toFloat(); float yourInputFloat = readFile(LittleFS, "/inputFloat.txt").toFloat();
Serial.print("*** Your inputFloat: "); Serial.print("*** Your inputFloat: ");
Serial.println(yourInputFloat); Serial.println(yourInputFloat);
Serial.println("===========================");
delay(5000); delay(5000);
} }

Loading…
Cancel
Save