本文整理汇总了Python中interface.Interface.setSerClient方法的典型用法代码示例。如果您正苦于以下问题:Python Interface.setSerClient方法的具体用法?Python Interface.setSerClient怎么用?Python Interface.setSerClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类interface.Interface
的用法示例。
在下文中一共展示了Interface.setSerClient方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Interface
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import setSerClient [as 别名]
'''
Created on Jan 25, 2014
@author: zeroshiiro
'''
import serial
from interface import Interface
if __name__ == "__main__":
#Connect with serial device, change as per device
ser = serial.Serial("/dev/ttyACM0", 115200, timeout = 1)
#Connect with Serial Interface
ifObj = Interface()
ifObj.setSerClient(ser)
#Start thread
ifObj.start()
# The above reader threads are blocking and non-terminated, so the best way to stop this python
# program is to hit Ctrl+Z and kill this process
print("Exiting main thread\n")