PeterH,
did you really fail to read and understand my apology.
astrofrostbyte
The section below the code block is probably the most significant part of the code.
as wrote:
The following code is where i beleive the response would arrive.
i have tried adding lines of code to read a particular buffer location ie Rxdata = (buf [1]);
and then do a println to see content but nothing happens.
any suggestions would be greatly appreciated :-
the lines
// receive response
byte buf [20];
byte received = recvMsg (fAvailable, fRead, buf, sizeof buf);
digitalWrite (LED_PIN, received == 0); // turn on LED if error
// only send once per successful change
if (received)
{
if (buf
!= channel)
return; // not my device
if (buf [1] != 2)
return; // unknown command
byte msg [] = {
0, // device 0 (master)
data, // turn light on command received
//data
are what happens when the slave device sends the acknowledge.
i sent the entire code because PaulS complains if i dont.