本文整理汇总了Python中transmitter.Transmitter.send方法的典型用法代码示例。如果您正苦于以下问题:Python Transmitter.send方法的具体用法?Python Transmitter.send怎么用?Python Transmitter.send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类transmitter.Transmitter
的用法示例。
在下文中一共展示了Transmitter.send方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _send_code
# 需要导入模块: from transmitter import Transmitter [as 别名]
# 或者: from transmitter.Transmitter import send [as 别名]
def _send_code(code):
pi = pigpio.pi()
tx = Transmitter(pi, PIN)
tx.send(code)
time.sleep(1)
tx.cancel()
示例2: Transmitter
# 需要导入模块: from transmitter import Transmitter [as 别名]
# 或者: from transmitter.Transmitter import send [as 别名]
from transmitter import Transmitter
from receiver import Receiver
import atexit
SEND_ADDRESS = "c"
RECEIVE_ADDRESS = "c"
MINIMUM_BLINK_TIME = 1000
if __name__ == '__main__':
transmitter = Transmitter(minimum_blink_time = MINIMUM_BLINK_TIME, send_address = SEND_ADDRESS)
receiver = Receiver(transmitter, minimum_blink_time = MINIMUM_BLINK_TIME, address = RECEIVE_ADDRESS)
def cleanup():
transmitter.cleanup()
receiver.cleanup()
GPIO.cleanup()
atexit.register(cleanup)
while True:
message = input("message: ")
transmitter.send(message)