bolderflight / sbus

Arduino and CMake library for communicating with SBUS receivers and servos.
MIT License
373 stars 132 forks source link

How to add Compatibility with the Arudino Micro and Arudino Leonardo #31

Closed mschindler301 closed 3 years ago

mschindler301 commented 4 years ago

I have found a way to add compatibility with the Arduino Micro and Arduino Lenardo (ATMega32u4 based boards). According to the Arduino Serial Reference, the ATMega32u4 uses Serial1 as its main and only Serial port.

In SBUS.cpp, I added this line to the end of the SBUS::begin()

_bus->begin(_sbusBaud, SERIAL_8E2); //For ATMega32u4

And it works! That is the only modification you need to make to the library to make this compatible with ATMega32u4 boards, and I thought this would be a great addition to the library to support more boards.

flybrianfly commented 3 years ago

Added.

robomaniac commented 2 years ago

was this implemented? I don't see SBUS::begin() and don't see any ATmega32u4 in the SBUS.cpp file.

I get the classic #include error AVR user have when I select 32u4 board.

it's now SbusRx::Begin() and uart_->begin

robomaniac commented 2 years ago

ah, in #54 you mention older version

There's some older versions older versions of this library that support AVR; check the checklog.

do you need command line to check the logs? that is new to me. I did trial and error and it's 1.0.1 that compile with arduino. I still wish to learn how to check logs.

flybrianfly commented 2 years ago

I also maintain a CHANGELOG with notes on major changes between versions. Seems like v2.1.2 might also be an option.

robomaniac commented 2 years ago

I appreciated the help it does compile with 2.1.2 but had to install Embedded_Template_Library (obviously) preparing hardware to see if I can get it to work. Thanks