本文整理汇总了Python中transmitter.Transmitter.setDaemon方法的典型用法代码示例。如果您正苦于以下问题:Python Transmitter.setDaemon方法的具体用法?Python Transmitter.setDaemon怎么用?Python Transmitter.setDaemon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类transmitter.Transmitter
的用法示例。
在下文中一共展示了Transmitter.setDaemon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Transmitter
# 需要导入模块: from transmitter import Transmitter [as 别名]
# 或者: from transmitter.Transmitter import setDaemon [as 别名]
logging.debug("MC running NOT on RPi")
GPIO.setmode(GPIO.BCM)
GPIO.setup(LED, GPIO.OUT) # status LED
GPIO.output(LED, GPIO.HIGH) # switch on to indicate software startup
GPIO.setup(RELEASE, GPIO.OUT) # release pin
GPIO.output(RELEASE, GPIO.LOW) # disable release
GPIO.setup(RELEASE_FB, GPIO.IN) # release feedback pin
GPIO.setup(HEADSHOT, GPIO.OUT) # set shutoff to output
GPIO.output(HEADSHOT, GPIO.LOW) # disable shutoff
GPIO.setup(CAMERA, GPIO.OUT) # set cam power to output
GPIO.output(CAMERA, GPIO.HIGH) # enable camera power
# setup the transmitter thread
txthread = Transmitter()
txthread.setDaemon(True)
txthread.start()
# setup the GPS-listener thread
gpsthread = GPSListener()
gpsthread.setDaemon(True)
gpsthread.start()
# wait for at least a 2D-Fix from the GPS
while GPSListener.fix < 2:
pass
logging.info("MC GPS fix OK")
# indicate GPS fix on LED
for i in range(1,15):
GPIO.output(LED, GPIO.HIGH)