Aug-31-2021, 05:20 PM
Actually this is very helpful for me, and thank you for your every minute on this code. My goal is sending strings to the HC-05 with clicking on these buttons. And I think I can do this with using this code:
Here are the strings that bluetooth module understands:
For checking bluetooth connection
btcheck
For the bed
head up
head down
head fwd
head rev
head stop
level up
level down
level fwd
level rev
level stop
For TV
standby
mute
program up
program down
volume up
volume down
For curtain
roller close
roller open
roller down
roller up
roller stop
For air conditioner
ac on
ac off
import bluetooth def connect (): bd_addr = "00:19:08:00:30:24" port = 1 sock=bluetooth.BluetoothSocket(bluetooth.RFCOMM) sock.connect((bd_addr, port)) sock.send("standby") sock.close() connect()[error]Traceback (most recent call last): File "C:/Users/Ulaş/AppData/Local/Programs/Python/Python39/tryout8.py", line 1, in <module> import bluetooth ModuleNotFoundError: No module named 'bluetooth'[/error]I couldn't solve this error since I'm using win10 and As I understand it is much harder than doing it on linux. Like I said I can do this process on a windows program which is " https://www.microsoft.com/store/productId/9WZDNCRDFST8 " and when I write the strings (below) the arduino executes the command with using IR and RF.(this part is about Electricity which is the part that I understand mostly) Here is a photo of the Bluetooth terminal which is on the microsoft link.( For you to see the my usage style of that program). https://ibb.co/Rjssyvh >> As you can see on this when I wrote btcheck it responses as OK and I can understand that if it my pc is connected to the module or not. https://ibb.co/Pxt7k3h On this photo you can see that how I send the string commands such as standby, mute and head up.
Here are the strings that bluetooth module understands:
For checking bluetooth connection
btcheck
For the bed
head up
head down
head fwd
head rev
head stop
level up
level down
level fwd
level rev
level stop
For TV
standby
mute
program up
program down
volume up
volume down
For curtain
roller close
roller open
roller down
roller up
roller stop
For air conditioner
ac on
ac off