I am just starting to experiment with the nRF24L01 and trying to understand the code. In the line shown:
const byte address[][6]={"000001","000002"};
What do the empty square brackets and the 6 in square brackets mean.
TIA
I am just starting to experiment with the nRF24L01 and trying to understand the code. In the line shown:
const byte address[][6]={"000001","000002"};
What do the empty square brackets and the 6 in square brackets mean.
TIA
The variable named address is a 2 dimensional array.
The number in the first pair of square brackets is the number of rows in the array. If you leave it blank then the compiler will work out how many rows of data there are. In your example there are 2 rows
The number in the second pair of square brackets is the number of columns in each row of the array. You must provide this number as the compiler cannot work it out. In your example there are 6 columns of data in each row, one for each digit
Is this the first time that you have used arrays ?
I haven’t used arrays in Arduino but I know what an array is, I guess I need to look into them a bit more. Thanks for the reply.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.