Skip to content
Snippets Groups Projects
Commit 63e3fd12 authored by kanesk2's avatar kanesk2
Browse files

Upload New File

parent 575f97de
No related branches found
No related tags found
No related merge requests found
import bluetooth
host = "DC:A6:32:9F:D8:60" # The address of Raspberry PI Bluetooth adapter on the server.
port = 1
sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
sock.connect((host, port))
while 1:
text = input("Enter your message: ") # Note change to the old (Python 2) raw_input
if text == "quit":
break
sock.send(text)
data = sock.recv(1024)
data = data.decode()
output = data.split(",")
print("temperature from server: ", output[0])
print("battery from server: ", output[1])
sock.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment