Author Topic: PSX controller for dummies?  (Read 1742 times)

0 Members and 1 Guest are viewing this topic.

Offline supernoobTopic starter

  • Jr. Member
  • **
  • Posts: 12
  • Helpful? 1
PSX controller for dummies?
« on: October 18, 2009, 07:01:46 PM »
I need some help with interfacing the psx controller with the axon. I've read the tutorial but it dosnt help me much. Can some one give me a simple to follow step by step explination of how to get it to work? How to set up the project in avrstudio, what files to add ect.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: PSX controller for dummies?
« Reply #1 on: October 18, 2009, 08:33:47 PM »
Hmmmm its better for you to tell us what you have done so far, and where you got stuck. Several people have managed to follow the tutorial and got it to work.

Just try, and if you get confused we can help.

Offline supernoobTopic starter

  • Jr. Member
  • **
  • Posts: 12
  • Helpful? 1
Re: PSX controller for dummies?
« Reply #2 on: October 19, 2009, 10:20:15 AM »
I did try. I got the controller hooked up to the Axon. I don't under stand what files i need to include in my project and how to set up the project. I've made simple programs that move servos, get sensor data, blink leds ect..... using the axon source code, but this is a bit more than im used too. I get all kinds of errors when i build it.
So, If i start a new project lest say i name it "mycontroller". what do i need to do to get the MCU to display the controllers positons and button presses to terminal?
How do i use the information from the controller in my code to lets say make a led light up if i press up on the D-pad?
Any help would be appreciated thanx.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: PSX controller for dummies?
« Reply #3 on: October 19, 2009, 11:41:22 AM »
Try this:
http://www.societyofrobots.com/robotforum/index.php?topic=9188.0

And if it doesn't compile, post the errors so we can help you.

Offline supernoobTopic starter

  • Jr. Member
  • **
  • Posts: 12
  • Helpful? 1
Re: PSX controller for dummies?
« Reply #4 on: October 19, 2009, 12:12:13 PM »
thats what im using.
ok here is what i did.
1.  i made a new project and named it "PS2_Controller".
2. took the code from PS2_Controller.c that was in your link and pasted it into my "PS2_Controller.c" file.
3. added the PS2_Controller.h file to my project.
4. added #include "uart4.h" , #include "rprintf.h" , #include "timer640.h" , #include "PS2_Controller.h".
5. Added buffer.c , gloabl.c ,uart4.c, rprintf.c , timer640.c to the project.
6. Used external makefile and edited it for PS2_Controller instead of axon.
7. hit rebuild all

now i get this error. What am i doing wrong?



PS2_Controller.h:58: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'InitPS2Controller'
PS2_Controller.h:61: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'PollPS2Controller'
PS2_Controller.h:64: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'GetPS2AnalogMode'
PS2_Controller.h:68: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ForcePS2AnalogMode'
PS2_Controller.h:71: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'GetPS2Button'
make: *** [PS2_Controller.o] Error 1
Build failed with 5 errors and 0 warnings...

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: PSX controller for dummies?
« Reply #5 on: October 19, 2009, 02:03:45 PM »
Hmmmm what did you tell your code to do in your main()?

Offline supernoobTopic starter

  • Jr. Member
  • **
  • Posts: 12
  • Helpful? 1
Re: PSX controller for dummies?
« Reply #6 on: October 19, 2009, 03:06:48 PM »
Do you have the project that uses the controller that you can post? That way i can load it into avr studio and see if i can build it? And see what it is i"m doing wrong. ???

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: PSX controller for dummies?
« Reply #7 on: October 19, 2009, 03:12:33 PM »
Do you have the project that uses the controller that you can post? That way i can load it into avr studio and see if i can build it? And see what it is i"m doing wrong. ???
Nope . . . just ask JadeKnight for it.

Offline supernoobTopic starter

  • Jr. Member
  • **
  • Posts: 12
  • Helpful? 1
Re: PSX controller for dummies?
« Reply #8 on: October 19, 2009, 04:05:27 PM »
Ok thanx i'll send him a pm. I left my main empty, I wanted to make sure that i didnt add any errors.
so let me get this straight.
I should start a new project like i would for any other program. then add the PS2_Controler c file and header file to my project. All the #includes will be in my projects main c file "Myproject.c". then i need to call functions from the ps2_controler c file?

now you know why my name is supernoob lol
« Last Edit: October 19, 2009, 04:13:50 PM by supernoob »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: PSX controller for dummies?
« Reply #9 on: October 19, 2009, 04:22:45 PM »
Quote
I should start a new project like i would for any other program. then add the PS2_Controler c file and header file to my project. All the #includes will be in my projects main c file "Myproject.c". then i need to call functions from the ps2_controler c file?
yeap! Basically what you did is included a library, but didn't write a program that used it :P


Quote
now you know why my name is supernoob lol
so . . . what do you do when you have 5 years experience behind you? :P

Offline supernoobTopic starter

  • Jr. Member
  • **
  • Posts: 12
  • Helpful? 1
Re: PSX controller for dummies?
« Reply #10 on: October 19, 2009, 05:03:34 PM »
That still dosnt explain these errors does it?
I cant even call InitPS2Controller to initalize it because i cant build it.
I sent JadeKnight a pm hopefully he can send me a project he knows is working so i can see what im messing up.
Thanx for the help Admin!

PS2_Controller.h:58: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'InitPS2Controller'
PS2_Controller.h:61: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'PollPS2Controller'
PS2_Controller.h:64: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'GetPS2AnalogMode'
PS2_Controller.h:68: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ForcePS2AnalogMode'
PS2_Controller.h:71: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'GetPS2Button'
make: *** [PS2_Controller.o] Error 1
Build failed with 5 errors and 0 warnings...

 


Get Your Ad Here

data_list