EasyManua.ls Logo

Emakefun RF-NANO - Program Code

Emakefun RF-NANO
34 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Copy right © 2018 Shenzhen Emakefun Technology co., Ltd.
25
3.2.2 program code
Transmitting data program 1 code
Code pathRF-NANO Demo Program\Multiple send to one receive communication\Emitter1
\Emitter1.ino
Source code
#include <SPI.h>
#include "Mirf.h"
#include "nRF24L01.h"
#include "MirfHardwareSpiDriver.h"
Nrf24l Mirf = Nrf24l(10, 9);
int value;
void setup()
{
Serial.begin(9600);
Mirf.spi = &MirfHardwareSpi;
Mirf.init();
//Set your own address (sender address) using 5 characters
Mirf.setRADDR((byte *)"ABCDE");
Mirf.payload = sizeof(value);
Mirf.channel = 10; //Set the channel used
Transmitting device 1
RF-NANO
Receiving device
RF-NANO
Transmitting device 2
RF-NANO