mirror of
https://github.com/lowobservable/coax.git
synced 2026-03-10 12:58:20 +00:00
Add serial port environment variable to examples
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
import sys
|
||||
import time
|
||||
import os
|
||||
from serial import Serial
|
||||
|
||||
sys.path.append('..')
|
||||
|
||||
from coax import SerialInterface, poll, poll_ack
|
||||
|
||||
SERIAL_PORT = '/dev/ttyACM0'
|
||||
DEFAULT_SERIAL_PORT = '/dev/ttyACM0'
|
||||
|
||||
def create_serial():
|
||||
port = SERIAL_PORT
|
||||
port = os.environ.get('COAX_PORT', DEFAULT_SERIAL_PORT)
|
||||
|
||||
print(f'Opening {port}...')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user