Replies: 2 comments 3 replies
-
I think my starting post was not clear, so I will try to simplify my needs: @laurensvalk , could you guide me in the right direction here? Here’s what I need to achieve:
Sound's pretty easy, but I still cannot find this for pybrick. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Is it still slow with motor.dc instead of motor.run? Motor.run smoothly decelerates, so changing speed rapidly is going to appear slow when it is just physically taking time to stop or reverse. |
Beta Was this translation helpful? Give feedback.
-
Hi All,
I need to develop my own Android app to control the hub as a remote control with advanced features. Using only an Xbox controller isn't sufficient for my needs, as I require additional real-time telemetry data to demonstate it on smartphone screen.
I found a potential solution here: https://pybricks.com/projects/tutorials/wireless/hub-to-device/pc-communication/.
But I found a bit specific (connection to Hub before program runs). But Ok, i have test it with my test C# program with BLE support (I have useed this service: c5f50001-8280-46da-89f4-6d8051e4aeef), and while it works fine, but I noticed significant latency. The program just send's command (value from 0 to 255) while I changed the slider. And ofcourse I have limit the amount of data by using a 15ms interval. (It is perfectly work's with Lego native firmware SPIKE/Inventor with native BLE implementation).
To evaluate the issue, I created a small test program. It transmits a single value and runs one motor to measure the response time. However, I observed that commands are getting queued, causing the motor to execute stacked commands, changing speed and direction with noticeable delay.
Please review my POC for hub. I've stripped out everything that could increase the latency:
My question is: is there an alternative solution for sending and receiving data without delays (similar to the Xbox controller approach) that would be compatible with connecting to an Android smartphone via BLE for use with a my custom app?
I’m hoping there’s a native solution similar to this example: https://github.com/pybricks/micropython-bleradio/blob/master/examples/custom_irq.py.
However, I haven’t been able to find one so far. The example uses specific channels like BLERadio(observe_channels=[4, 18], broadcast_channel=5, ble=ble), but I can’t integrate this with my Android app.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions