this is my node to node program:
// Enable debug prints
#define MY_DEBUG
#define SWITCH_PIN 2
// Enable and select radio type attached
#define MY_RADIO_NRF24
//#define MY_RADIO_RFM69
boolean state=false;
#include <SPI.h>
#include <MySensor.h>
#define MY_NODE_ID 10
#define CHILD_ID_SWITCH 1
MyMessage switchMsg(CHILD_ID_SWITCH, V_LIGHT);
void setup()
{
pinMode(SWITCH_PIN,INPUT_PULLUP);
}
void loop()
{
if(digitalRead(SWITCH_PIN)==LOW)
{
delay(100);
if(digitalRead(SWITCH_PIN)==HIGH);
{
state=!state;
if(state)
{
send(switchMsg.setDestination(2).set(49));
}
else
{
send(switchMsg.setDestination(2).set(0));
}
}
}
}
destination node id is 2
destination of type light variable