Skip to content
Snippets Groups Projects

Serial Monitor Script

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Fatih Uzunoglu
    monitor.py 342 B
    # Simple Serial Monitor
    
    import serial
    import io
    
    ser = serial.Serial(port="COM3", baudrate=115200)
    
    while True:
        line = ser.readline()
        if line == b'':
            continue
       
        print(line)
        
        if not line.startswith(b'Enter Command:'):
            continue
        
        _input = input()
        ser.write(_input.encode('ascii'))
    
    ser.close()
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment