Here are the instructions how to convert the sketch. Please try and if you run in to trouble please let me know and I will walk you through it.
Converting sketch from 1.5 to to 2.0
Add the following to activate NRF-radio support
#define MY_RADIO_NRF24
Remove MySensor constructor
MySensors gw;
Remove MySensors setup() call
gw.setup(....);
If node expects incoming messages, add the following function to handle data:
void receive(const MyMessage &msg) {}
Move present() and sendSketchInfo() from setup() to a new function called presentation().
void presentation() {
sendSketchInfo(...)
present(...);
}
If youβre using static ids , add:
#define MY_NODE_ID xx
If static parent node is used, add:
#define MY_PARENT_NODE_ID xx
If you want node to be a repeater, add
#define MY_REPEATER_FEATURE
If you need to reconfigure your CE/CS Pins (not needed if NRF is connected to default pins)
#define MY_RF24_CE_PIN 9
#define MY_RF24_CS_PIN 10
Remove all βgw.β before MySensors library calls.
If node requests time using requestTime(), remove callback argument define define the following function to handle time response:
void receiveTime(unsigned long ts) {
}
Make sure to include MySensors.h after any configuration defines.