baldeau 12f8631c0f
Some checks failed
xiao_pet_tracker / semantic-pull-request (push) Failing after 0s
xiao_pet_tracker / build (push) Failing after 0s
xiao_pet_tracker / spell-check (push) Failing after 0s
update
2024-11-12 13:57:14 +01:00

16 lines
433 B
Python
Executable File

#!/usr/bin/env python
from subprocess import run
# requires pySerial:
# python -m pip install pyserial
import serial
# grab the port for the seeed nrf52 (only connect one at a time)
data = run("ls /dev/ | grep 'cu.usbmodem'", capture_output=True, shell=True, text=True)
ser = serial.Serial("/dev/" + data.stdout.strip(), 1200)
# send 16 null characters as reset signal to enter the bootloader
ser.write(b"\x00" * 16)
ser.close()