PROBLEMS WITH BLUETOOTH AND CORE 2
-
I have code in Python, written using Ui Flow, to control some motors through the core 2 screen. However, I would like to control my motors through the cell phone, thus using the cell phone in the same way I use the core2 screen.
At first I just want to send information from my cell phone to the M5Stack via Bluetooth, I saw on the Internet that I could use MIT APP Inventor for this, so I followed this tutorial on YouTube: "https://www.youtube.com/watch?v= E495XIsM1PI&t=5s"
I just added a button that sends the text "A" via bluettoh to the connected device.
However, I can't quite make the connection! Does the M5stack appear in my cell phone's Bluetooth settings, but does not appear in the inventor app?
If anyone can help, I appreciate it! I'm desperate because it's urgent and I don't know what else to do, I don't have much knowledge about bluetooth connectionsOh, and this is the code I ran in Ui FloW:
"from m5stack import *
from m5stack_ui import *
from uiflow import *
from ble import ble_uartscreen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)label0 = M5Label('TEXT', x=142, y=69, color=0x000, font=FONT_MONT_14, parent=None)
uart_ble = ble_uart.init('M5Stackfire')
whileTrue:
label0.set_text(str(uart_ble.read()))
received_data = uart_ble.read()
if received_data:
if received_data == b'A':
label0.set_text('A')
else:
label0.set_text('No A received')
wait_ms(2)"
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login