zendes / SBUS

Arduino library for the Futaba SBUS protocol
GNU General Public License v2.0
127 stars 63 forks source link

Will not compile for Arduino Leonardo #3

Open Dagroid opened 8 years ago

Dagroid commented 8 years ago

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.

zendes commented 8 years ago

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

Dagroid commented 8 years ago

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

eskaflon commented 5 years ago

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

Gerifield commented 4 years ago

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!)