arduino/bluetooth

This commit is contained in:
2022-11-17 23:19:32 +00:00
parent 7fa822fc42
commit bc2ad07dbd
3 changed files with 170 additions and 0 deletions

View 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()