mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-02-05 08:05:42 +00:00
Add python code to simulate AMS data
This commit is contained in:
13
Debugging/Code/SerialSimulator/ams_serial_simulator.py
Normal file
13
Debugging/Code/SerialSimulator/ams_serial_simulator.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import serial
|
||||
import time
|
||||
import sys
|
||||
|
||||
import sample_data
|
||||
|
||||
with serial.Serial(port='COM15', baudrate=2400, bytesize=8, parity='E', stopbits=1) as ser:
|
||||
for packet in sample_data.kaifa_20190508_packets:
|
||||
print('sleeping')
|
||||
sys.stdout.flush()
|
||||
time.sleep(2)
|
||||
ser.write(packet)
|
||||
|
||||
Reference in New Issue
Block a user