Arduino 1.0.5 IDE on Raspi using Mini 8x8 LED Matrix w/I2C Backpack

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
victort
 
Posts: 6
Joined: Mon Jul 08, 2013 12:11 pm

Arduino 1.0.5 IDE on Raspi using Mini 8x8 LED Matrix w/I2C Backpack

Post by victort »

Hello Everyone,

I plan to use raspi as a desktop replacement for compiling and programming Arduino.
I have ran into few problems when I load matrix8x8 example.
First of all I installed arduino 1.0.1 in raspi using these commands:

sudo apt-get install arduino
sudo apt-get install avr-libc
sudo apt-get install libftdi1
sudo apt-get install avrdude
sudo apt-get install openjdk-6-jre
sudo apt-get install librxtx-java
cp /usr/bin/avrdude /home/pi/arduino
cp /etc/avrdude.conf /home/pi/arduino

Then I have updated to 1.0.5 using these command which I found in http://tech.cyborg5.com/2013/05/30/irli ... pberry-pi/

wget http://arduino.googlecode.com/files/ard ... inux32.tgz
tar zxvf arduino-1.0.5-linux32.tgz
cd arduino-1.0.5
rm -rf hardware/tools

sudo cp -ru lib /usr/share/arduino
sudo cp -ru libraries /usr/share/arduino
sudo cp -ru tools /usr/share/arduino
sudo cp -ru hardware /usr/share/arduino
sudo cp -ru examples /usr/share/doc/arduino-core
sudo cp -ru reference /usr/share/doc/arduino-core

When I compiled the example some errors came out saying that smile_bmp, neutral_bmp and frown_bmp should be cons instead of static.
When I changed it to const, more problems came out.

Did anyone have tried to compile the examples of matrix8x8 on Raspi's Arduino 1.0.5 IDE?

Regards,

Victor

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Arduino 1.0.5 IDE on Raspi using Mini 8x8 LED Matrix w/I2C Backpack

Post by adafruit_support_mike »

Apparently the 1.0.5 version of the IDE changed some of the underlying compiler settings to be more strict. Another user ran into a similar issue trying to get Hunt the Wumpus to work on the RGB LCD Shield.

What are the exact errors you get when you compile the original code, and what errors do you get when you try to make them consts instead of static?

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Arduino 1.0.5 IDE on Raspi using Mini 8x8 LED Matrix w/I2C Backpack

Post by pburgess »

This also seems to be related to some recent changes in Adafruit_GFX. I've updated the Adafruit_LEDBackpack examples on Github to fix this -- please download the latest, see if that helps.

Previously in some of that code (roboface example), the Adafruit_8x8matrix() constructor was being called at runtime, e.g.:

Code: Select all

Adafruit_8x8matrix matrix[4];
void setup() {
  for(uint8_t i=0; i<4; i++) {
    matrix[i] = Adafruit_8x8matrix();
    matrix[i].begin(matrixAddr[i]);
  }
}
Because some class elements have now been made 'const', this is no longer viable -- the constructor must be called in the declaration, e.g.:

Code: Select all

Adafruit_8x8matrix matrix[4] = { // Array of Adafruit_8x8matrix objects
  Adafruit_8x8matrix(), Adafruit_8x8matrix(),
  Adafruit_8x8matrix(), Adafruit_8x8matrix() };
void setup() {
  for(uint8_t i=0; i<4; i++) {
    matrix[i].begin(matrixAddr[i]);
  }
}
Bit of a nuisance, but it's technically the right thing to do, like eating your oatmeal. The same problem might be lurking in other code on Github, but rare...let me know if you find any, I'll take care of squashing them.

victort
 
Posts: 6
Joined: Mon Jul 08, 2013 12:11 pm

Re: Arduino 1.0.5 IDE on Raspi using Mini 8x8 LED Matrix w/I2C Backpack

Post by victort »

I have downloaded and added the library and hour ago and here are the errors during compiling:
1) this error comes out without modification:
matrix8x8.ino:36:13: error: variable ‘smile_bmp’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
matrix8x8.ino:45:15: error: variable ‘neutral_bmp’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
matrix8x8.ino:54:13: error: variable ‘frown_bmp’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’

2) 2nd error after I change static to const:
/usr/share/arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp: In constructor ‘Adafruit_8x8matrix::Adafruit_8x8matrix()’:
/usr/share/arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp:92:65: error: no matching function for call to ‘Adafruit_GFX::Adafruit_GFX(int, int)’ /usr/share/arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp:92:65: note: candidates are: In file included from /usr/share/arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.h:28:0,from /usr/share/arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp:22:
/usr/share/arduino/libraries/Robot_Control/Adafruit_GFX.h:41:7: note: Adafruit_GFX::Adafruit_GFX()
/usr/share/arduino/libraries/Robot_Control/Adafruit_GFX.h:41:7: note: candidate expects 0 arguments, 2 provided
/usr/share/arduino/libraries/Robot_Control/Adafruit_GFX.h:41:7: note: Adafruit_GFX::Adafruit_GFX(const Adafruit_GFX&)
/usr/share/arduino/libraries/Robot_Control/Adafruit_GFX.h:41:7: note: candidate expects 1 argument, 2 provided
/usr/share/arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp: In constructor ‘Adafruit_BicolorMatrix::Adafruit_BicolorMatrix()’:/usr/share/arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp:128:73: error: no matching function for call to ‘Adafruit_GFX::Adafruit_GFX(int, int)’ /usr/share/arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp:128:73: note: candidates are:
In file included from /usr/share/arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.h:28:0,
from /usr/share/arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp:22:
/usr/share/arduino/libraries/Robot_Control/Adafruit_GFX.h:41:7: note: Adafruit_GFX::Adafruit_GFX()
/usr/share/arduino/libraries/Robot_Control/Adafruit_GFX.h:41:7: note: candidate expects 0 arguments, 2 provided
/usr/share/arduino/libraries/Robot_Control/Adafruit_GFX.h:41:7: note: Adafruit_GFX::Adafruit_GFX(const Adafruit_GFX&)
/usr/share/arduino/libraries/Robot_Control/Adafruit_GFX.h:41:7: note: candidate expects 1 argument, 2 provided

victort
 
Posts: 6
Joined: Mon Jul 08, 2013 12:11 pm

Re: Arduino 1.0.5 IDE on Raspi using Mini 8x8 LED Matrix w/I2C Backpack

Post by victort »

it seems to be the same error on 1.0.1 and 1.0.5.
can you verify that the location I have copied in raspi is correct?
Btw, did you ever have tried to compile any of the examples in raspi?
there seems to be no problem in win7 tho

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Arduino 1.0.5 IDE on Raspi using Mini 8x8 LED Matrix w/I2C Backpack

Post by adafruit_support_mike »

It looks like the changes Phil suggested above will fix the problems with the compiler.

As for file locations on the RasPi, I haven't installed the Arduino IDE there myself, but if it runs, tells you it's version 1.0.5, and has all the boards you need under Tools -> Board, then you probably did everything correctly.

victort
 
Posts: 6
Joined: Mon Jul 08, 2013 12:11 pm

Re: Arduino 1.0.5 IDE on Raspi using Mini 8x8 LED Matrix w/I2C Backpack

Post by victort »

Hello

I have downloaded new Arduino into another pc together with the new GFX and backpack libraries.
I still have the same error as in the raspi.
I am still quite new to Arduino and doesnt understand much C++ and its classes.
Can you explain to me what should be done from your instruction above?
Where and what file/s I should modify the codes?

Please note that I am just compiling (Cntrl + R on win7 pc) and my Arduino is not yet connected to the USB port.
Other sample programs seems to have no problem, only this backpack sample programs.

Regards,

Victor

D:\working\Z1_Victor\Arduino\arduino-1.0.5\libraries\Adafruit_LEDBackpack\Adafruit_LEDBackpack.cpp: In constructor 'Adafruit_8x8matrix::Adafruit_8x8matrix()':
D:\working\Z1_Victor\Arduino\arduino-1.0.5\libraries\Adafruit_LEDBackpack\Adafruit_LEDBackpack.cpp:92: error: no matching function for call to 'Adafruit_GFX::Adafruit_GFX(int, int)'
D:\working\Z1_Victor\Arduino\arduino-1.0.5\libraries\Robot_Control/Adafruit_GFX.h:41: note: candidates are: Adafruit_GFX::Adafruit_GFX(const Adafruit_GFX&)
D:\working\Z1_Victor\Arduino\arduino-1.0.5\libraries\Robot_Control/Adafruit_GFX.h:41: note: Adafruit_GFX::Adafruit_GFX()
D:\working\Z1_Victor\Arduino\arduino-1.0.5\libraries\Adafruit_LEDBackpack\Adafruit_LEDBackpack.cpp: In constructor 'Adafruit_BicolorMatrix::Adafruit_BicolorMatrix()':
D:\working\Z1_Victor\Arduino\arduino-1.0.5\libraries\Adafruit_LEDBackpack\Adafruit_LEDBackpack.cpp:128: error: no matching function for call to 'Adafruit_GFX::Adafruit_GFX(int, int)'
D:\working\Z1_Victor\Arduino\arduino-1.0.5\libraries\Robot_Control/Adafruit_GFX.h:41: note: candidates are: Adafruit_GFX::Adafruit_GFX(const Adafruit_GFX&)
D:\working\Z1_Victor\Arduino\arduino-1.0.5\libraries\Robot_Control/Adafruit_GFX.h:41: note: Adafruit_GFX::Adafruit_GFX()

victort
 
Posts: 6
Joined: Mon Jul 08, 2013 12:11 pm

Re: Arduino 1.0.5 IDE on Raspi using Mini 8x8 LED Matrix w/I2C Backpack

Post by victort »

I have an old copy of the LED and GFX libraries which are dated Oct-12-2012 which are working fine with Arduino 1.0.1.
So I tried copying the LED and GFX lib to 1.0.5 and got this error below.
I think I will stay away from the new LED and GFX libs and Arduino 1.0.5 for a while until this one got resolved and use my old working setup.
So I maybe use the same libs in raspi and test if it works.
Thanks anyway!

BTW, here's what I did, you can try it yourselves:
1. download the Arduino IDE
2. download the LED and GFX libs
3. extracts the zip files
4. rename the LED and GFX folders accordingly and copy to libraries
5. open the Arduino IDE exe file
6. click File > Examples > Adafruit_LED backpack > matrix8x8
7. Complile (I never code anything or edit anything, yet the error comes, both both I have posted previously and the one below)

D:\arduino\arduino-1.0.5\libraries\Robot_Control\ArduinoRobot.cpp: In constructor 'RobotControl::RobotControl()':
D:\arduino\arduino-1.0.5\libraries\Robot_Control\ArduinoRobot.cpp:8: error: 'LCD_CS' was not declared in this scope
D:\arduino\arduino-1.0.5\libraries\Robot_Control\ArduinoRobot.cpp:8: error: 'DC_LCD' was not declared in this scope
D:\arduino\arduino-1.0.5\libraries\Robot_Control\ArduinoRobot.cpp:8: error: 'RST_LCD' was not declared in this scope
D:\arduino\arduino-1.0.5\libraries\Robot_Control\ArduinoRobot.cpp: In member function 'void RobotControl::begin()':
D:\arduino\arduino-1.0.5\libraries\Robot_Control\ArduinoRobot.cpp:18: error: 'MUXA' was not declared in this scope
D:\arduino\arduino-1.0.5\libraries\Robot_Control\ArduinoRobot.cpp:18: error: 'MUXB' was not declared in this scope
D:\arduino\arduino-1.0.5\libraries\Robot_Control\ArduinoRobot.cpp:18: error: 'MUXC' was not declared in this scope
D:\arduino\arduino-1.0.5\libraries\Robot_Control\ArduinoRobot.cpp:18: error: 'MUXD' was not declared in this scope
D:\arduino\arduino-1.0.5\libraries\Robot_Control\ArduinoRobot.cpp:19: error: 'MUX_IN' was not declared in this scope
D:\arduino\arduino-1.0.5\libraries\Robot_Control\ArduinoRobot.cpp:22: error: 'BUZZ' was not declared in this scope
D:\arduino\arduino-1.0.5\libraries\Robot_Control\ArduinoRobot.cpp:25: error: 'Serial1' was not declared in this scope

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Arduino 1.0.5 IDE on Raspi using Mini 8x8 LED Matrix w/I2C Backpack

Post by adafruit_support_rick »

That is a bug in Arduino 1.0.5.
You can either go back down to 1.0.4, or you can delete the RobotControl library from the Arduino 1.0.5 application directory.

victort
 
Posts: 6
Joined: Mon Jul 08, 2013 12:11 pm

Re: Arduino 1.0.5 IDE on Raspi using Mini 8x8 LED Matrix w/I2C Backpack

Post by victort »

Since i know that there are some bugs in the new LED and GFX libs with the combination of Arduino 1.0.5.
So I decided to use my old LED and GFX libs dated Oct-12-2012 on my raspi.
Arduino is also 1.0.1 in the repository and I never updated to 1.0.5 yet.
Upon compiling the const error appear as what I have posted earlier, I just changed the bmps from static to const, as well as the font in glcdfont.c.
Now, the matrix8x8 example is now compiling and uploading using my raspi.
I hope this can be resolved soon
Thanks!

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Arduino 1.0.5 IDE on Raspi using Mini 8x8 LED Matrix w/I2C Backpack

Post by pburgess »

Declare the bitmaps as 'static const' (not just one or the other), should compile fine.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”