arduino/bluetooth
This commit is contained in:
21
arduino/bluetooth_serial_test.py
Executable file
21
arduino/bluetooth_serial_test.py
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
#
|
||||
# - Pair bluetooth useing bluetoothctl.
|
||||
# agent on
|
||||
# pair 20:16:02:14:58:51
|
||||
# - Setup serial connection:
|
||||
# sudo rfcomm bind hci0 20:16:02:14:58:51 1
|
||||
#
|
||||
# - For module
|
||||
# sudo apt-get install python-serial
|
||||
#
|
||||
|
||||
import serial
|
||||
from time import sleep
|
||||
|
||||
bluetoothSerial = serial.Serial( "/dev/rfcomm0", baudrate=9600 )
|
||||
|
||||
bluetoothSerial.write( "Test from python." )
|
||||
print bluetoothSerial.readline()
|
||||
|
||||
Reference in New Issue
Block a user