Changes between Version 6 and Version 7 of SujetTP6-2016


Ignore:
Timestamp:
Mar 18, 2016, 11:26:47 AM (9 years ago)
Author:
franck
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SujetTP6-2016

    v6 v7  
    128128
    129129
     130- baseSensor
     131{{{#!c
     132#include <SPI.h>
     133#include "RF24.h"
     134
     135RF24 radio(9,10);
     136
     137byte addresses[][6] = {"0Node","1Node","2Node","3Node","4Node","5Node"};
     138
     139void 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
     147void 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}}}