so.. Kindly explain the components of the line like,
~why there is a & in start
~why i have to write "sizeof"
and also guide me how to read characters from [radio.read] and convert it into something like,,
if radio.read is equal to a given character suppose "A",then DigitalWrite(pin1, HIGH) and if radio.read is "B" then DigitalWrite(pin2, HIGH)
...
THANKS (and sorry if my question is stupid )
Because the function needs to know the size of the array. An array is just a pile of variables ordered after each other in memory. But once you point something to a array it needs to know where the pile ends.
No0oB:
and also guide me how to read characters from [radio.read] and convert it into something like,,
if radio.read is equal to a given character suppose "A",then DigitalWrite(pin1, HIGH) and if radio.read is "B" then DigitalWrite(pin2, HIGH)
radio.read is a function. It is not equal to a given character. It places (copies) the packet from the
nRF24L01 chip into a memory buffer you supply (here called text).
///radio.read is a function. It is not equal to a given character. It places (copies) the packet from the
nRF24L01 chip into a memory buffer you supply (here called text).
You then look at whats in the buffer.
///
If you're only interested in if that package starts with a 'A' or a 'B', simply check the first char of that array against a 'A' or a 'B' like I showed you.