eris2010

Documentation: http://frombelow.net/projects/eris2010/
Clone: git clone https://git.frombelow.net/eris2010.git
Log | Files | Refs | README | LICENSE

reset.py (321B)


      1 #!/usr/bin/env python3
      2 """Trigger reset on 8-bit computer"""
      3 
      4 import serial
      5 import os
      6 
      7 SERIAL_PORT = '/dev/ttyUSB0'
      8 SERIAL_SPEED = 19200
      9 
     10 with serial.Serial(SERIAL_PORT, SERIAL_SPEED) as s:
     11     print("Triggering reset.")
     12     os.system('stty -F ' + SERIAL_PORT + ' -hup')
     13     l = ""
     14     s.setDTR(False)
     15     s.setDTR(True)