Raspberry Pi Pico SBUS Code Help

Great that you’ve got this mostly working to your liking.

Any chance you can share the sbus_driver_micropython translated code that now works with a Pi Pico? I’m trying to do something similar and would prefer not to re-invent the wheel.

Thanks!

1 Like

https://github.com/themitch22/sbus_driver_micropython I forked the sbus receiver library with my fixes issues with the modern micropython implementation for the Pi Pico RP2040 UART methods. I used a different main code for my application but it was built on the example code. Let me know if this works for you! note: I still used a discrete logic inverter circuit to invert UART. Also my use case, I had to add a buffer random failsafe flags when the signal was bad.

1 Like

Hello, I have not great expirience in micropython and i have struggle to get my sbus reader useful. Could you share your main code or exprein me how i need to change sbus_driver_example.py to make it working. I know that I should change pyb to machine but i don"t know how to change function pyb.timer

Thanks!

1 Like

GitHub - themitch22/sbus_driver_micropython: a Micropython driver for the SBUS protocol Here’s the updated code I made. I used a transistor and resistors to invert the SBUS signal for the UART to read. Also self.sbus.any() returns a bool which was causing it to never enter the read loop.

In my use I also had a buffer array to prevent failsafe bits from causing issues.

1 Like


I see, but I am saking for this code, I am not sure what I should change to get your result :slight_smile:

1 Like

Sorry I’ll have to find my actual example script and upload it to extract it. I basically used a state machine and flag loop depending on which transmitter switch was triggered.

1 Like

Thank you in advance. I hope you find your code :slight_smile: