Skip to content

Commit ced9af2

Browse files
camera: store timestamp in filename
1 parent 7330a17 commit ced9af2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • internal_filesystem/apps/com.micropythonos.camera/assets

internal_filesystem/apps/com.micropythonos.camera/assets/camera.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
print(f"Info: could not import webcam module: {e}")
1414

1515
from mpos.apps import Activity
16+
import mpos.time
1617

1718
class Camera(Activity):
1819

@@ -176,7 +177,7 @@ def snap_button_click(self, e):
176177
except OSError:
177178
pass
178179
if self.current_cam_buffer is not None:
179-
filename="data/images/camera_capture.raw"
180+
filename=f"data/images/camera_capture_{mpos.time.epoch_seconds()}.raw"
180181
try:
181182
with open(filename, 'wb') as f:
182183
f.write(self.current_cam_buffer)

0 commit comments

Comments
 (0)