Skip to content

Instantly share code, notes, and snippets.

@raucao
Created August 29, 2019 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raucao/42ccc72124821997f43ca34dbf12539a to your computer and use it in GitHub Desktop.
Save raucao/42ccc72124821997f43ca34dbf12539a to your computer and use it in GitHub Desktop.
"""Script to reset time on CardIO via serial, run on HOST computer
inspired by: https://badge.team/projects/suckless_flash
"""
from __future__ import print_function
import sys, time
dev=open("/dev/ttyACM0", "w")
print(chr(0x03), end="", file=dev)
cmd = "import utime; utime.set_unix_time({})\r"
print(cmd.format(int(time.time())), file=dev)
print(chr(0x04), end="", file=dev)
dev.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment