Multiwii & PS2 controller & xbee

Post Reply
Mous94
Posts: 4
Joined: Fri Aug 17, 2012 5:31 pm

Multiwii & PS2 controller & xbee

Post by Mous94 »

hello,

I want to know if it is possible to control the multiwii with the PS2 controller.

here is the link to the PS2 controller: http://www.billporter.info/playstation- ... rary-v1-0/

and here the structure variables recut by the arduino multiwii by the serial link:
http://www.billporter.info/easytransfer ... o-library/

thank you for you help

Alterscape
Posts: 11
Joined: Fri Jan 27, 2012 9:17 pm

Re: Multiwii & PS2 controller & xbee

Post by Alterscape »

Is it possible? Yes. Tommie has some custom firmware that's been used by Pyrofer to drive a regular RC transmitter with a PS2 controller (Tommie's also used it to get a lot of features out of a very cheap radio). It would be possible to modify that setup to use the xbee instead, and likewise modify multiwii to receive data via xbee rather than PPM from an RC receiver. The bigger question in my mind is "why bother?" when there're plenty of inexpensive radio options out there (9x and friends, primarily). $65 USD + shipping may seem expensive, but I can almost guarantee you that it'll be cheaper and more robust than a homebrew solution, unless you're interested in solving the problem for its own sake.

jy0933
Posts: 180
Joined: Wed Jun 27, 2012 4:24 pm

Re: Multiwii & PS2 controller & xbee

Post by jy0933 »

Alterscape wrote:Is it possible? Yes. Tommie has some custom firmware that's been used by Pyrofer to drive a regular RC transmitter with a PS2 controller (Tommie's also used it to get a lot of features out of a very cheap radio). It would be possible to modify that setup to use the xbee instead, and likewise modify multiwii to receive data via xbee rather than PPM from an RC receiver. The bigger question in my mind is "why bother?" when there're plenty of inexpensive radio options out there (9x and friends, primarily). $65 USD + shipping may seem expensive, but I can almost guarantee you that it'll be cheaper and more robust than a homebrew solution, unless you're interested in solving the problem for its own sake.


[opinion]but if you can use one xbee for radio control and data feed back at the same time.. wont it be better than having a whole set of extra radio/data system?

Mous94
Posts: 4
Joined: Fri Aug 17, 2012 5:31 pm

Re: Multiwii & PS2 controller & xbee

Post by Mous94 »

hello,
thank you for your answer.

why? I actually already two xbee from a previous project.
and I like chalenges and satisfaction that can be drawn in if you succeed.
_______

Then, here's what I want to do but I this error message that appears when I compile my code:

Code: Select all

SoftwareSerial\SoftwareSerial.cpp.o: In function `__vector_5':
C:\Users\multi\Dropbox\arduino-1.0.1\libraries\SoftwareSerial/SoftwareSerial.cpp:316: multiple definition of `__vector_5'
MultiWii_2_1.cpp.o:C:\Users\multi\AppData\Local\Temp\build4935098758099262038.tmp/MultiWii_2_1.cpp:6158: first defined here
core.a(HardwareSerial.cpp.o): In function `__vector_18':
C:\Users\multi\Dropbox\arduino-1.0.1\hardware\arduino\cores\arduino/HardwareSerial.cpp:100: multiple definition of `__vector_18'
MultiWii_2_1.cpp.o:C:\Users\multi\AppData\Local\Temp\build4935098758099262038.tmp/MultiWii_2_1.cpp:8800: first defined here
core.a(HardwareSerial.cpp.o): In function `__vector_19':
C:\Users\multi\Dropbox\arduino-1.0.1\hardware\arduino\cores\arduino/HardwareSerial.cpp:192: multiple definition of `__vector_19'
MultiWii_2_1.cpp.o:C:\Users\multi\AppData\Local\Temp\build4935098758099262038.tmp/MultiWii_2_1.cpp:8728: first defined here



what i want to do :

Code: Select all

   case MSP_SET_RAW_RC:
     for(uint8_t i=0;i<8;i++) {
       


rcData[0] = variableXG  // joystick gauche axe x  état entre 0 et 254. le point mort du joystick vaut 254/2 environ.
rcData[1] = variableXD
rcData[2] = variableYG
rcData[3] = variableYD

rcData[4] = variableBt1  // bouton état 0 ou 1
rcData[5] = variableBt2
rcData[6] = variableBt3
rcData[7] = variableBt4



     }
     headSerialReply(0);
     break;




This is struct of RX code of xbee :

Code: Select all


#include <SoftEasyTransfer.h>
#include <PS2X_lib.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
SoftEasyTransfer ET;
struct RECEIVE_DATA_STRUCTURE{
 
  int variableXG  ;
  int variableXD  ;
  int variableYG  ;
  int variableYG  ;
 
  int variableBt1  ;
  int variableBt2  ;
  int variableBt3  ;
  int variableBt4  ;
 
 
};

RECEIVE_DATA_STRUCTURE mydata;

void setup(){
   mySerial.begin(9600);
 
  ET.begin(details(mydata), &mySerial);


}

void loop(){
 
 
  //check and see if a data packet has come in.
  if(ET.receiveData()){
   
 
    Serial.print(mydata.variableXG);
     Serial.print(",");
      Serial.print(mydata.variableXD);
      Serial.print(",");
      Serial.print(mydata.variableYG);
      Serial.print(",");
      Serial.print(mydata.variableYG);
  }
 
  delay(5);
}



thank you for you help :oops:

Mous94
Posts: 4
Joined: Fri Aug 17, 2012 5:31 pm

Re: Multiwii & PS2 controller & xbee

Post by Mous94 »

:oops: :oops: And sorry for my bad english....i aam french :D

Alterscape
Posts: 11
Joined: Fri Jan 27, 2012 9:17 pm

Re: Multiwii & PS2 controller & xbee

Post by Alterscape »

No worries about the language! And I totally agree/respect your reasons for wanting to do this, for the record -- was just saying if you want to save money or time, this is not the way. :) I'm not sure what to do about your include problem, but good luck! I'm curious how this works out (and swamped with real work right now, sadface).

Post Reply