Joystick Remote control for Arduino

Joystick Shield for Arduino

The idea is to build a Bluetooth remote control but I have some problems to find the right pinout.
It seems to be that the Nokia LCD connection use the same pins like the nRF24L01 connection.

I wonder if its possible to use a LCD screen and Bluetooth together ?

Someone who has already used this for a remote control ?

Unfortunately I have no experience with the shield.

I like Ebay (had to check the picture), since you can buy nice products for little money, but it´s often a disaster to find good info on those products. I've just tried to find more info, this one certainly qualifies as "disaster".

I'm afraid you'll need to check how pins are connected by your self.

Sharing the same pins doesn't have to be a problem, you can connect several I2C components to the same pins for example and as long as they use a different Chip-select pin, you can operate several devices using the SPI-port as well.

I would try to reverse engineer the shield first and create a schematic, by checking all pins using a multimeter.

After that it may perhaps be possible to adapt your code to work with the shield as it is or...
cut a few PCB-traces and solder new ones, so that it can work with your code.

Would you be using both nrf24l01 and bluetooth in your project by the way ?

Reverse engineering part one 8)

Joystick module :
X Pot > to Arduino A0
Y Pot > to Arduino A1
GND > to Arduino GND
VCC > to Arduino +5V

Button Pins :
A (Up) - to Arduino pin 2
B (Right) - to Arduino pin 3
C (Down) - to Arduino pin 4
D (Left) - to Arduino pin 5
GND > to Arduino GND
VCC > to Arduino +5V

RF24L0 pins :
1 > to GND
2 > to VCC 3.3V
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 > not connected

First try with the joystick shield 8)

They talk to each other :wink:

/* Joystick Receiver

   1 > GND
   2 > VCC 3.3V
   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 > not connected
    */

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <Servo.h>
#define CEpin 9
#define CSNpin 10
  
const uint64_t pipe = 0xE1E1F0F0E1LL; // Define the transmit pipe
RF24 radio(CEpin, CSNpin); //  Radio
int joystick[6];  //Joystick readings

void setup()  
{
  Serial.begin(9600);
  Serial.println("RF24L Startup Receiver");
  radio.begin();
  radio.openReadingPipe(1,pipe);
  radio.startListening();;
}

void loop()   
{
  if ( radio.available() )
  {
        bool done = false;
    while (!done)
    {
      done = radio.read( joystick, sizeof(joystick) );
      int joystickX = map(joystick[0],0,1023,0,180); // change the value of 0-1023 to 0-180 degrees
      int joystickY = map(joystick[1],0,1023,0,180);  // change the value of 0-1023 to 0-180 degrees
      
      // four button A B C D 
      int upbut = joystick[2];
      int rightbut = joystick[3];
      int downbut = joystick[4];
      int lefttbut = joystick[5];
      
      Serial.print("X = ");
      
      Serial.print(joystickX);
      Serial.print(" Y = ");  
      
      Serial.print(joystickY);
      Serial.print(" Up = ");
      
      Serial.print(joystick[2]);
      Serial.print(" Right = ");  
      
      Serial.print(joystick[3]);
      Serial.print(" Down = ");
      
      Serial.print(joystick[4]);
      Serial.print(" Left = ");  
      
      Serial.println(joystick[5]);
          
    }
  }
}
/* JoyStick Shield

  Joystick module :
X Pot > to Arduino A0
Y Pot > to Arduino A1
GND > to Arduino GND
VCC > to Arduino +5V

Button Pins : 
A  (Up) - to Arduino pin 2 
B  (Right) - to Arduino pin 3
C  (Down) - to Arduino pin 4
D  (Left) - to Arduino pin 5
GND > to Arduino GND
VCC > to Arduino +5V

RF24L0 pins :
1 > to  GND
2 > to VCC 3.3V 
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 > not connected
*/

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define CEpin 9
#define CSNpin 10
#define JOYSTICK_X A0
#define JOYSTICK_Y A1

const uint64_t pipe = 0xE1E1F0F0E1LL; // Define the transmit pipe

RF24 radio(CEpin, CSNpin); //  Radio

int joystick[6];  // Joystick reading and 4 buttons
int upbut = 2;
int rightbut = 3;
int downbut = 4;
int leftbut = 5;
void setup()  
{
  Serial.begin(9600);
  radio.begin();
  radio.openWritingPipe(pipe);
  
  //pinMode for the buttons 
  pinMode(upbut,INPUT);
  pinMode(rightbut,INPUT);
  pinMode(downbut,INPUT);
  pinMode(leftbut,INPUT);
  digitalWrite(downbut,LOW);
  digitalWrite(upbut,LOW);
  digitalWrite(upbut,LOW);
  digitalWrite(leftbut,LOW);
  }

void loop()   
{
  joystick[0] = analogRead(JOYSTICK_X);
  joystick[1] = analogRead(JOYSTICK_Y);
  joystick[2] = digitalRead(upbut);
  joystick[3] = digitalRead(rightbut);
  joystick[4] = digitalRead(downbut);
  joystick[5] = digitalRead(leftbut);
  
  radio.write( joystick, sizeof(joystick) );

    // Debugging code 
      Serial.print("X = ");
      Serial.print(analogRead(JOYSTICK_X));
      Serial.print(" Y = ");  
      Serial.print(analogRead(JOYSTICK_Y));
      Serial.print(" Y = ");  
      Serial.print(" Up = "); 
      Serial.print(digitalRead(upbut));
      Serial.print(" Right = "); 
      Serial.print(digitalRead(rightbut));
      Serial.print(" Down = "); 
      Serial.print(digitalRead(downbut));
      Serial.print(" Left = "); 
      Serial.println(digitalRead(leftbut));
            
}

Unfortunately it takes long time to connect. Not sure why ...