Author Topic: using Adafruit LED Backpack Library (for Arduino)  (Read 2092 times)

0 Members and 1 Guest are viewing this topic.

mga

using Adafruit LED Backpack Library (for Arduino)
« on: April 08, 2013, 07:46:07 PM »
Hi

I am following this tutorial for connecting their LED matrices and controllers:

http://learn.adafruit.com/adafruit-led-backpack/0-8-8x8-matrix

But their code comes for Arduino:

https://github.com/adafruit/Adafruit-LED-Backpack-Library

I imagine it is possible to make it work in Wiring. After modifying the call to Arduino.h to Wiring.h and running an example they provide (roboface) I get this error:

/Users/xxx/Documents/Wiring/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp: In member function 'void Adafruit_LEDBackpack::writeDisplay()':
/Users/xxx/Documents/Wiring/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp:80: error: call of overloaded 'write(unsigned int)' is ambiguous
/Applications/Wiring.app/Contents/Resources/Java/cores/AVR8Bit/libraries/Wire/Wire.h:54: note: candidates are: virtual void TwoWire::write(uint8_t)
/Applications/Wiring.app/Contents/Resources/Java/cores/AVR8Bit/libraries/Wire/Wire.h:55: note:                 void TwoWire::write(int)
/Applications/Wiring.app/Contents/Resources/Java/cores/AVR8Bit/libraries/Wire/Wire.h:56: note:                 virtual void TwoWire::write(const char*) <near match>
/Users/xxx/Documents/Wiring/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp:81: error: call of overloaded 'write(uint16_t)' is ambiguous
/Applications/Wiring.app/Contents/Resources/Java/cores/AVR8Bit/libraries/Wire/Wire.h:54: note: candidates are: virtual void TwoWire::write(uint8_t)
/Applications/Wiring.app/Contents/Resources/Java/cores/AVR8Bit/libraries/Wire/Wire.h:55: note:                 void TwoWire::write(int)
/Applications/Wiring.app/Contents/Resources/Java/cores/AVR8Bit/libraries/Wire/Wire.h:56: note:                 virtual void TwoWire::write(const char*) <near match>


Any idea if this is easily fixable? It would be cool to be able to use that LED display and backpack in Wiring with their library.

Thanks

barragan

Re: using Adafruit LED Backpack Library (for Arduino)
« Reply #1 on: April 08, 2013, 09:15:55 PM »
in /Users/xxx/Documents/Wiring/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp:80: error: call of overloaded 'write(unsigned int)' change it to

write(int)

and in /Users/xxx/Documents/Wiring/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp:81: error: call of overloaded 'write(uint16_t)'

change it to write(int) as well.

These changes should work.

mga

Re: using Adafruit LED Backpack Library (for Arduino)
« Reply #2 on: April 08, 2013, 09:59:17 PM »
Thanks for the reply. The answer itself didn't work but pointed me towards where the problem was.

What I did was cast all calls to Wire.write(whatever) in the Adafruit library as Wire.write((uint8_t)whatever). Sometimes "whatever" was a more complex statement so I surrounded the whole thing with parenthesis.

The result:

https://vine.co/v/btWJQxD9phO

:)

Thanks

barragan

Re: using Adafruit LED Backpack Library (for Arduino)
« Reply #3 on: April 10, 2013, 12:09:30 PM »
looks great : )