SBUS icon indicating copy to clipboard operation
SBUS copied to clipboard

Will not compile for Arduino Leonardo

Open Dagroid opened this issue 9 years ago • 4 comments

It seems this library is currently incompatible with the ATmega32u4 from the Arduino Leonardo (built into a DFrobot Romeo in my case). Could this library be made compatible? This SBUS library would be great on this robot controller! Thank you.

Here is my Arduino IDE 1.6.4 error messages:

...\arduino-1.6.4\libraries\SBUS\SBUS.cpp: In member function 'void SBUS::begin(bool)': ...arduino-1.6.4\libraries\SBUS\SBUS.cpp:11:3: error: 'TCCR2A' was not declared in this scope TCCR2A = 0; ^ ...\arduino-1.6.4\libraries\SBUS\SBUS.cpp:12:3: error: 'TCCR2B' was not declared in this scope TCCR2B = 0; ^ ...\arduino-1.6.4\libraries\SBUS\SBUS.cpp:13:3: error: 'TCNT2' was not declared in this scope TCNT2 = 0; ^ ...\arduino-1.6.4\libraries\SBUS\SBUS.cpp:14:3: error: 'OCR2A' was not declared in this scope OCR2A = 249; ^ ...\arduino-1.6.4\libraries\SBUS\SBUS.cpp:15:19: error: 'WGM21' was not declared in this scope TCCR2A |= (1 << WGM21); ^ ...\arduino-1.6.4\libraries\SBUS\SBUS.cpp:16:19: error: 'CS22' was not declared in this scope TCCR2B |= (1 << CS22); ^ Error compiling.

Dagroid avatar Nov 15 '15 23:11 Dagroid

Let me look into this a bit. The 32u4 probably uses different register names than the 328 I tested it on.

zendes avatar Nov 18 '15 21:11 zendes

Awesome, hopefully it's something relatively simple to add in.

Dagroid avatar Nov 24 '15 23:11 Dagroid

Any updates on this issue? I have the same problem.

eskaflon avatar Oct 24 '18 06:10 eskaflon

I had a similar issue with a Pro Micro. This helped a lot: https://github.com/froqstar/SBUSJoystick (Just changed the cpp and it worked!)

Gerifield avatar Sep 07 '20 21:09 Gerifield