Created
May 30, 2022 07:00
-
-
Save idriszmy/479befe5c3fa475d785ccd9ef080b880 to your computer and use it in GitHub Desktop.
Bluetooth HC-05 master-slave configuration using CircuitPython.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Bluetooth HC-05 master-slave configuration using CircuitPython | |
Items: | |
- Maker Pi Pico | |
https://my.cytron.io/p-maker-pi-pico | |
- Bluetooth Serial Transceiver HC-05 | |
https://my.cytron.io/p-bluetooth-serial-transceiver-hc-05 | |
- USB Micro B Cable | |
https://my.cytron.io/p-usb-micro-b-cable | |
- Grove 4 Pin Buckled to Female Cable | |
https://my.cytron.io/p-grove-4-pin-buckled-to-female-cable | |
References: | |
- https://howtomechatronics.com/tutorials/arduino/how-to-configure-pair-two-hc-05-bluetooth-module-master-slave-commands/ | |
Last update: 30 May 2022 | |
""" | |
import board | |
import busio | |
hc05 = busio.UART(board.GP4, board.GP5, baudrate=38400) | |
while True: | |
command = input() + "\r\n" | |
hc05.write(bytes(command, 'ascii')) | |
while True: | |
response = hc05.readline() | |
if response == None: | |
break | |
print(str(response, 'UTF-8')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment