@@ -32,16 +32,7 @@ void setup() {
3232 }
3333
3434 // Set the nodeID to 0 for the master node
35- mesh.setNodeID (0 );
36- Serial.println (mesh.getNodeID ());
37- // Connect to the mesh
38- if (!mesh.begin ()) {
39- // if mesh.begin() returns false for a master node, then radio.begin() returned false.
40- Serial.println (F (" Radio hardware not responding." ));
41- while (1 ) {
42- // hold in an infinite loop
43- }
44- }
35+ mesh.setNodeID (0 ); // must be called before setStaticAddress()
4536
4637 // In this case, assign a static address to nodeIDs 23,24 at RF24Network address 02 && 03
4738 // This will prevent this master node from assigning the address to another node
@@ -51,10 +42,20 @@ void setup() {
5142 // With this example, assign nodes 02 and 03 statically. This allows child nodes to join
5243 // the network as children of 00(master), node 02, or node 03, or as children of other
5344 // mesh nodes. If nodes 02 and 03 are placed in proximity to a group of mesh nodes, the
54- // mesh nodes can attatch to the network via the static nodes, and route traffic through
45+ // mesh nodes can attach to the network via the static nodes, and route traffic through
5546 // either node, to the master node.
5647 mesh.setStaticAddress (23 , 02 );
5748 mesh.setStaticAddress (24 , 03 );
49+
50+ Serial.println (mesh.getNodeID ());
51+ // Connect to the mesh
52+ if (!mesh.begin ()) {
53+ // if mesh.begin() returns false for a master node, then radio.begin() returned false.
54+ Serial.println (F (" Radio hardware not responding." ));
55+ while (1 ) {
56+ // hold in an infinite loop
57+ }
58+ }
5859}
5960
6061uint32_t displayTimer = 0 ;
0 commit comments