练习: 蓝牙连接 – 手机到PC
创建一个应用程序能够让手机通过蓝牙连接到你PC。这个程序能够在手机上书写,并能在PC上接收到。
- 你需要使用 socket module :
- 让蓝牙扫描发现PC上的BT地址和服务,并连接上PC
- 创建一个能够触发一个文本输入框并能发送输入内容从蓝牙到PC终端的函数
注意:
确认在你的PC蓝牙连接软件上进行了正确的设置:
- 鼠标右键点击蓝牙图标 -> 通信 -> 超级终端
- 选择选项标签,确定”Turn discovery on”被选择
- 选择 COM 端口标签,确定COM端口“连入”为可用,如果没有,创建一个新的COM端口
Create a Hyper terminal:
- got to Accessories -> Communications -> Hyperterminal
- give a name and choose an icon, codess ok, then choose in the “connect using” field the COM port of your “incoming port”, codess ok
- make the Hyper teminal active by clicking the “call” button.
- start now the python script on the phone.
0 Responses to “从蓝牙连接PC”