refactor(basic-demo): reorganize storage paths and module names

This commit is contained in:
zhouli
2026-04-17 12:01:32 +08:00
parent 32b7e758bd
commit f0107802bd
53 changed files with 411 additions and 478 deletions
@@ -8,7 +8,7 @@ This skill describes how to correctly use camera when writing Lua scripts.
- Call `camera.info()` to get stream information such as `width`, `height`, and `pixel_format`
- Call `camera.get_frame([timeout_ms])` to borrow one raw frame
- Call `camera.release_frame(frame)` or `frame:release()` after using a borrowed frame
- Call `camera.capture(save_path [, timeout_ms])` to capture a frame to a `.jpg` or `.jpeg` path under `/fatfs/data/`
- Call `camera.capture(save_path [, timeout_ms])` to capture a frame to a `.jpg` or `.jpeg` path under the current storage root
- Call `camera.close()` when the camera is no longer needed
## Frame lifecycle
@@ -43,7 +43,8 @@ local frame_info = frame:info()
print(frame_info.width, frame_info.height, frame_info.pixel_format, frame:bytes())
frame:release()
local capture = camera.capture("/fatfs/data/capture.jpg", 3000)
local storage = require("storage")
local capture = camera.capture(storage.join_path(storage.get_root_dir(), "capture.jpg"), 3000)
print(capture.path, capture.bytes)
camera.close()
```