| | 130 | - baseSensor |
| | 131 | {{{#!c |
| | 132 | #include <SPI.h> |
| | 133 | #include "RF24.h" |
| | 134 | |
| | 135 | RF24 radio(9,10); |
| | 136 | |
| | 137 | byte addresses[][6] = {"0Node","1Node","2Node","3Node","4Node","5Node"}; |
| | 138 | |
| | 139 | void setup() { |
| | 140 | Serial.begin(115200); |
| | 141 | radio.begin(); |
| | 142 | radio.setPALevel(RF24_PA_LOW); |
| | 143 | radio.openReadingPipe(1,addresses[0]); |
| | 144 | radio.startListening(); |
| | 145 | } |
| | 146 | |
| | 147 | void loop() { |
| | 148 | unsigned long got_time; |
| | 149 | |
| | 150 | if( radio.available()){ |
| | 151 | radio.read( &got_time, sizeof(unsigned long) ); // Get the payload |
| | 152 | Serial.println(got_time); |
| | 153 | } |
| | 154 | } |
| | 155 | }}} |