bytes and nibbles

I am busy just trying to put together some building blocks for my next sketch, and I keep tripping over this confusion on my part. The top code works fine to display a 7x5 matrix character :-

   byte displayArrayA[5] = {63,63,136,72,72};
  lc.setRow(0,0,displayArrayA[0]);
 lc.setRow(0,1,displayArrayA[1]);
  lc.setRow(0,2,displayArrayA[2]);
 lc.setRow(0,3,displayArrayA[3]);
 lc.setRow(0,4,displayArrayA[4]);

So I thought I would tidy it up by having a variable for the 0 -4 in each line :-

 for (x=o; x<=4; x++ ) {  
  lc.setRow(0,x,displayArrayA[x]);
  }

But it tells me I am trying to convert an integer to a byte or a byte to a byte, or whatever, I have tried all the religions when declaring the x , but am getting confused again.
I have searched and somebody had a similar hassle but it was to do with pointers that I havnt come across yet.

Feel free to tell me I am missing the obvious again.

Hi Boffin1

You haven’t posted where you declare the variable x. You could try this:

for (int x=0; x<=4; x++ ) {  
  lc.setRow(0,x,displayArrayA[x]);
  }

EDIT The “x=o” was a letter o, not a number 0, in your post.

According to the source code for LedControl on GitHub, the setRow() function takes integer for the first two parameters and byte for the last. And you have the array declared as array of bytes.

void setRow(int addr, int row, byte value);

If the change in the for loop does not fix it, can you copy and paste the exact error messages you are getting.

Regards

Ray

for (x=o; x<=4; x++ )

You have a ‘o’ not a ‘0’ for x
[edit] Sorry it was answered already. I got interrupted, should have refreshed the screen before posting.

I’ve done that too. Have to watch the 0’ and o’s also 1’s and l’s.

Yes thanks, I had just spotted it and called myself a name that my wife often hears :-)

Thanks Guys

Boffin1: Yes thanks, I had just spotted it and called myself a name that my wife often hears :-)

"Darling"?

Not quite , more like " Ah, So " :-)

This thread shows absolutely the advantage of the Arduino community, I made a stupid mistake that my Great Grandson would not have typed , and instead of wasting a whole day finding it, you guys picked it up.

I am not interested in trying raspberries or whatever, I have had so much support ( even though I am still stuck in V22 until I can find a few hours to upgrade my libraries to V1.05 ) and its working for me, who didn't have a clue about micros 3 years ago ( at 63 )

This thread reminded me of a colleague long ago, in the far-off years BW (Before Web) who bought a BBC micro, then got his wife ( who was a trained typist) to transcribe onto it a large BASIC program from a magazine. Unfortunately, in that far-distant past, typewriters (and so typists) didn't distinguish between 'l' and '1', or between '0' and 'O' . . .

You got that right!

Ans some tired old guys in the middle of the night still get them transposed ,,,, :-)

Add ( /{ and )/} to the list http://forum.arduino.cc/index.php?topic=247360.0

Too true.