-2

The error I get is as follows:

F:\Josh\GIZDUINO PROJECT\Joshua\arduino-1.8.3\libraries\arduino-ledcube-master\examples\ledcube\ledcube.pde: In function 'void loop()':

ledcube:49: error: taking address of temporary array
         cube.createFrame((byte[]) {0,6, 1,6, 2,6}, 6, 80),
                                                         ^
ledcube:50: error: taking address of temporary array
         cube.createFrame((byte[]) {0,7, 1,7, 2,7}, 6, 70),
                                                         ^
ledcube:51: error: taking address of temporary array
         cube.createFrame((byte[]) {0,8, 1,8, 2,8}, 6, 60),
                                                         ^
ledcube:52: error: taking address of temporary array
         cube.createFrame((byte[]) {0,5, 1,5, 2,5}, 6, 50),
                                                         ^
ledcube:53: error: taking address of temporary array
         cube.createFrame((byte[]) {0,2, 1,2, 2,2}, 6, 40),
                                                         ^
ledcube:54: error: taking address of temporary array
         cube.createFrame((byte[]) {0,1, 1,1, 2,1}, 6, 30),
                                                         ^
ledcube:55: error: taking address of temporary array
         cube.createFrame((byte[]) {0,0, 1,0, 2,0}, 6, 20),
                                                         ^
ledcube:56: error: taking address of temporary array
         cube.createFrame((byte[]) {0,3, 1,3, 2,3}, 6, 10)
                                                         ^
F:\Josh\GIZDUINO PROJECT\Joshua\arduino-1.8.3\libraries\arduino-ledcube-master\examples\ledcube\ledcube.pde:115:38: warning: narrowing conversion of '(((int)cube.LedCube::getLevels()) + 1)' from 'int' to 'byte {aka unsigned char}' inside { } [-Wnarrowing]
     byte planes[] = {cube.getLevels()+1,cube.getLevels(),cube.getLevels()*2,1};
                                      ^
F:\Josh\GIZDUINO PROJECT\Joshua\arduino-1.8.3\libraries\arduino-ledcube-master\examples\ledcube\ledcube.pde:115:74: warning: narrowing conversion of '(((int)cube.LedCube::getLevels()) * 2)' from 'int' to 'byte {aka unsigned char}' inside { } [-Wnarrowing]
     byte planes[] = {cube.getLevels()+1,cube.getLevels(),cube.getLevels()*2,1};
                                                                          ^

exit status 1
taking address of temporary array

closed as unclear what you're asking by Majenko, Michel Keijzers, gre_gor, Edgar Bonet, SDsolar Jul 26 '17 at 17:30

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Learn C syntax. – Majenko Jul 26 '17 at 15:08
  • 1
    Welcome to Arduino Stack Exchange. Please take the tour at arduino.stackexchange.com/Tour to see how to get the most out of this site. You will see the difference between between how this works here and your question. Perhaps you can edit this to make it answerable; but if not then you will be ready for next time. – SDsolar Jul 26 '17 at 17:30
  • Gizduino is garbage. The fact that they instruct you to install their hardware definitions to the IDE installation folder shows they lack the most basic understanding of Arduino. Send the board back for a refund. – per1234 Jul 26 '17 at 21:50
2

Three remarks to your question.

  1. Avoid using UPPERCASE as that is considered to be a typographical notation for shouting. See http://practicaltypography.com/all-caps.html

  2. The compiler error is due to that you are using a temporary byte vector as parameter. You should declare the vector as a local or global variable and pass the reference. See https://stackoverflow.com/questions/42332229/how-to-pass-a-temporary-array or web-search for more info.

  3. The compiler warning is due to an implicit conversion from int to byte. The conversion may result in a loss of precision thus the warning. You can use a type cast to avoid this. The type case will tell the compiler that you know what you are doing.

Cheers!

1

You have to declare your array by itself, with a name, like this:

void fcn(byte p[]) {  
  Serial.print("p[1]=");
  Serial.println(p[1]);
}

void setup() {
  Serial.begin(9600);

  byte ar[] = {0, 6, 1, 6, 2, 6};
  fcn( ar);
  }

void loop() {  
}

And the warning are for using a int where a byte is expected. It's just a warning. There is no problem as long the values are between 0 and 255.

Not the answer you're looking for? Browse other questions tagged or ask your own question.