forked from emakefun/rf-nano
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSend.ino
45 lines (39 loc) · 1.04 KB
/
Send.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <SPI.h>
#include <Wire.h>
#include "RF24.h"
#include "printf.h"
RF24 SendRadio(9, 10);
int value;
void WriteData()
{
value = random(255);
SendRadio.openWritingPipe(0xF0F0F0F066);//Sends data on this 40-bit address
SendRadio.write(&value, sizeof(value));
Serial.print("WriteData");
Serial.print(".........");
Serial.println(value);
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
printf_begin();
Serial.println(F("LGT RF-NANO v2.0 Send Test"));
//
// Setup and configure rf radio
//
// Get into standby mode
SendRadio.begin();
SendRadio.setAddressWidth(5);
SendRadio.openWritingPipe(0xF0F0F0F066LL);
SendRadio.setChannel(115); //115 band above WIFI signals
SendRadio.setPALevel(RF24_PA_MAX); //MIN power low rage
SendRadio.setDataRate(RF24_1MBPS) ; //Minimum speed
SendRadio.stopListening(); //Stop Receiving and start transminitng
Serial.print("Send Setup Initialized");
SendRadio.printDetails();
delay(500);
}
void loop() {
WriteData();
delay(1000);
}