pika_littlefs Examples
This document introduces pika_littlefs’s purpose and basic usage. pika_littlefs provides LittleFS filesystem support, usually accessed through os module in OPBTPython (such as open, read, write, listdir, os.path, etc.). Reference: doc/pikapython.com/_sources/API_pika_littlefs.md.txt, main manual “Standard Library Introduction”.
Module Introduction
pika_littlefs is the underlying filesystem driver, after mounting can be accessed through standard file interfaces. Built-in example:
#!pika
import os
# After LittleFS mounting, use os for file operations
os.listdir('/')
f = open('/data/config.txt', 'r')
s = f.read()
f.close()
#!pika
Usage Instructions
- Filesystem is generally mounted by firmware at startup, script side can directly use
open(),os.path,os.listdir(), etc. to read/write files on LittleFS. - If need to explicitly mount or configure in script, please check if device documentation provides pika_littlefs mounting API.
- Paths and directory structure follow actual device configuration.