Using Two Nordic nRF24L01 2.4 Wireless Radio with Joystick and Arduino
We will going to demonstrate here how to use Nordic nRF24L01 2.4 Wireless Radio using Arduino with Joystick Controller. This 2.4Ghz Radio module are base on Nordic Semiconductor nRF24L01+ Chip,
The Nordic nRF24L01+ integrates a complete 2.4GHz Radio Frequency Transceiver, Radio Frequency Synthesizer, and Baseband Logic including the Enhance ShockBurst hardware protocol accelerating a high speed SPI interface for the application controller and low -power short-range transceiver and it has a built in on-board antenna other model it has SMA integrated antenna with a range up to 1100 Meter.
Features:
2 ore more Arduino’s be able to communicate wirelessly over a distance.
Controlling a nearby buildings
Controlling Autonomous vehicles of all kinds
Excellent for a remote sensors for temperature, pressure, distance, switching, alarm and more.
Controlling and monitoring a robot a range up to 2000 feet distance
We will going to transmits a communication between to Arduinos over NRF24L01 using Joystick
Note: Problem accure when operation because of electrical noise on 3.3v supply, specially when using Arduino Mega and Nano we need to add bypass capacitor across ground and vcc on the module. please see the schematics below.
/* Testing nRF24L01 Receive Joystick values to NRF24l01 Module
1 - GND
2 - VCC 3.3V /* WARNING SHOULD BE 3.3v Not 5V */
3-CE-Arduino pin9
4-CSN-Arduino pin10
5-SCK-Arduino pin13
6-MOSI-Arduino pin11
7-MISO-Arduino pin12
8-UNUSED
/*----- Import all required Libraries -----*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
/*----- Declare all constant pin to be used ----*/
#define CE_PIN 9
#define CSN_PIN 10
constuint64_t pipe=0xE8E8F0F0E1LL;// This is the transmit pipe to communicate the two module
/*-----Object Declaration ----*/
RF24 radio(CE_PIN,CSN_PIN);// Activate the Radio
/*-----Declaration of Variables -----*/
intjoystick[2];// Two element array holding the Joystick readings
voidsetup()
{
Serial.begin(9600);/* Opening the Serial Communication */
delay(1000);
Serial.println("Nrf24L01 Receiver Starting");
radio.begin();
radio.openReadingPipe(1,pipe);
radio.startListening();;
}//--(end setup )---
voidloop()
{
if(radio.available())
{
// Reading the data payload until the RX received everything
booldone=false;
while(!done)
{
// Fetching the data payload
done=radio.read(joystick,sizeof(joystick));
Serial.print("X = ");
Serial.print(joystick[0]);
Serial.print(" Y = ");
Serial.println(joystick[1]);
}
}
else
{
Serial.println("No radio available");
}
}
Note: you need to check the voltage 3.3v power supply, it will distract the operation due to power regulation issues, the average current may be less 15ma.
Using Two Nordic nRF24L01 2.4 Wireless Radio with Joystick and Arduino
Arduino: 1.6.9 (Windows 7), Board: “Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”
J:\nRF24\rx\rx.ino: In function ‘void loop()’:
rx:43: error: void value not ignored as it ought to be
done = radio.read( joystick, sizeof(joystick) );
^
Multiple libraries were found for “nRF24L01.h”
Used: C:\Users\dholu\Documents\Arduino\libraries\RF24
Not used: C:\Program Files\Arduino\libraries\RF24-master
Not used: C:\Program Files\Arduino\libraries\RF24-master
Not used: C:\Program Files\Arduino\libraries\RF24-master
Not used: C:\Program Files\Arduino\libraries\RF24-master
exit status 1
void value not ignored as it ought to be
This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.
We use cookie to provide you the best possible experience, this site uses cookies and by continuing to use the site you agree that we can save them on your device. Cookies are small text files which are placed on your computer and which remember your preference / some details of your visit. Our cookies don’t collect any personal information. For information, please read our Privacy Statement and Cookie Policy , which also explains how to disable this option in your browser. Cookie SettingsACCEPT
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are as essential for the working of basic functionalit...
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
Arduino: 1.6.9 (Windows 7), Board: “Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”
J:\nRF24\rx\rx.ino: In function ‘void loop()’:
rx:43: error: void value not ignored as it ought to be
done = radio.read( joystick, sizeof(joystick) );
^
Multiple libraries were found for “nRF24L01.h”
Used: C:\Users\dholu\Documents\Arduino\libraries\RF24
Not used: C:\Program Files\Arduino\libraries\RF24-master
Not used: C:\Program Files\Arduino\libraries\RF24-master
Not used: C:\Program Files\Arduino\libraries\RF24-master
Not used: C:\Program Files\Arduino\libraries\RF24-master
exit status 1
void value not ignored as it ought to be
This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.
Please help me how can i fixed this problem?