mynight2012

# coding:utf-8
import time
import serial
import string
import binascii
import linecache

FilePath="G:\\WorkSVN\\TPMS\\TOOLS\\R01\\App\\APP_FIFO\\SampleCode\\tpmsRcode\\TDATEST\\12_spi.def"

file = open(FilePath,\'rb\')
c = file.read(1)
count = linecache.getline(FilePath,100)

lines = open(FilePath,\'rb\').readlines()

ser = serial.Serial()
ser.baudrate = 115200
ser.port = \'COM3\'
ser.open()
print(ser.isOpen())

print(lines.__len__())
for linx in lines:
    ser.write(linx)
    time.sleep(0.01)
    str = ser.read_all()
    print(str)
ser.write(\'go\n\'.encode())
time.sleep(0.1)
str = ser.read_all()
print(str)
ser.close()

分类:

技术点:

相关文章:

  • 2021-05-28
  • 2021-09-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2023-04-04
  • 2021-11-24
猜你喜欢
  • 2021-06-23
  • 2021-08-03
  • 2021-10-15
  • 2021-10-07
  • 2021-09-05
  • 2021-12-18
相关资源
相似解决方案