So I've been trying to build a transmitter, and I've designed it in Eagle and ordered the PCBs. Everything should work just fine, but sadly it doesn't.. printDetails gives me the following:
Does anyone have a clue?
The code I'm using can be found below:
/*
http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo
1 - GND
2 - VCC 3.3V !!! NOT 5V
3 - CE to Arduino pin 9
4 - CSN to Arduino pin 10
5 - SCK to Arduino pin 13
6 - MOSI to Arduino pin 11
7 - MISO to Arduino pin 12
8 - UNUSED*/
#include <Input.h>
#include <Joystick.h>
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>
#define X_Left A1
#define Y_Left A0
#define B_Left A5
#define X_Right A3
#define Y_Right A2
#define B_Right A7
#define CE_PIN 9
#define CSN_PIN 10
#define SWITCH A6
// NOTE: the "LL" at the end of the constant is "LongLong" type
const uint64_t RADIO_PIPE = 0xABCDABCD71LL; // Define the transmit pipe
Joystick Left( X_Left, Y_Left, B_Left ), Right( X_Right, Y_Right, B_Right );
Input Switch( SWITCH );
RF24 radio( CE_PIN, CSN_PIN ); // Create a Radio
byte joystick[ 5 ];
#define DEBUG
#ifdef DEBUG
#define DEBUG_PRINT(x) Serial.print(x)
#define DEBUG_PRINTLN(x) Serial.println(x)
#else
#define DEBUG_PRINT(x)
#define DEBUG_PRINTLN(x)
#endif
void init_Radio( void );
void setup()
{
#ifdef DEBUG
Serial.begin( 115200 );
#endif
delay( 1000 );
DEBUG_PRINTLN( "Start" );
init_Radio( );
}
void loop( )
{
joystick[ 0 ] = Left.XByte( );
joystick[ 1 ] = Left.YByte( );
joystick[ 2 ] = Right.XByte( );
joystick[ 3 ] = Right.YByte( );
joystick[ 4 ] = byte( digitalRead( SWITCH ) );
radio.write( joystick, sizeof( joystick ) );
/*
DEBUG_PRINT( "Left:\tX=" );
DEBUG_PRINT( joystick[ 0 ] );
DEBUG_PRINT( ", Y=" );
DEBUG_PRINTLN( joystick[ 1 ] );
DEBUG_PRINT( "Right:\tX=" );
DEBUG_PRINT( joystick[ 2 ] );
DEBUG_PRINT( ", Y=" );
DEBUG_PRINTLN( joystick[ 3 ] );
DEBUG_PRINT( "Switch: \t" );
DEBUG_PRINTLN( joystick[ 4 ] );*/
}
void init_Radio( void )
{
radio.begin( );
//radio.enableAckPayload( );
//radio.setAutoAck( false );
// optionally, increase the delay between retries & # of retries
radio.setRetries(15,15);
DEBUG_PRINTLN( "Retries" );
// optionally, reduce the payload size. seems to
// improve reliability
radio.setPayloadSize(8);
DEBUG_PRINTLN( "Payload Size" );
radio.openWritingPipe( RADIO_PIPE );
DEBUG_PRINTLN( "Writing Pipe" );
radio.powerUp( );
radio.startListening( );
radio.printDetails( );
DEBUG_PRINTLN( "Details" );
}
I've attached both the Eagle schematic and Eagle board file.
transmitter_v2.zip (49.4 KB)