i have a few “little”
questions about the ps2
controller
first off
how does the basic atom know if the jotsticks are being pressed?
i have a few “little”
questions about the ps2
controller
first off
how does the basic atom know if the jotsticks are being pressed?
In the tutorial [HERE], I believe that the L3 and R3 values referenced under section #8 in the display refer to the tact switches on the left and right joysticks, respectively. Specifically, the second column of data will report a value of 253 if the left stick is being pressed down, and a value of 251 if the right stick is depressed.
You’ll have to deconstruct the program a bit in order to translate that into usable data and responses, but it’s a pretty good starting point.
Edit: swapped left/right
More specifically: Bits 1 and 2 correspond to the pressed/not-pressed states of the left and right stick buttons, respectively.
so basicly
what your saying is that the microcontroller recognizes the joystick values?
Take a look at that tutorial that I linked to earlier. The program contained therein executes a loop which reads the data coming from the PS2 controller, and displays it in the debug window. You would use a similar set of routines in your program to poll the controller, analyze the returned data, and use that to determine how the program branches, to activate various behaviors and routines.
In the case of the left and right joystick pushbuttons earlier, you would look specifically at the second and third bits of the second byte listed there, in order to know the status of the joystick switches. Similarly, you would be able to look at other bytes of the returned data for, say, the position of the left stick’s Y-axis, or the amount of force being applied to the controller’s R2 or triangle buttons. From there, your program could be written to jump to a certain routine or change its behavior in some way, in response to your inputs at the controller.
As it comes, there is not a simple way to simply ask the microcontroller, “Is the L1 button being pushed lightly?” or, “Is the right joystick being pushed more than halfway to the left?” You will need to do a bit of programming in order to get the information from the controller before you will be able to act upon it.
The code supplied with the various tutorials and demo programs will provide you with a basic framework to work from, but they will no doubt involve some deconstruction of the code, and reverse-engineering it to your own purposes. A lot of code is well-documented , but you may well run into bits of code which you do not immediately understand. That’s where the microcontroller’s documentation and syntax manual becomes an invaluable resource. If you see a command you aren’t familiar with, you can look it up in the manual, and it will list all of the variables and arguments that are associated with using that command, so you can figure out where it’s getting its data from, and what it’s doing with it. If you really and truly get stuck in understanding a bit of code, you can probably find someone here in the forums who will be able to help you to understand it better, but I find that I learn far more from studying the syntax manual and figuring code out for myself than if someone simply tells me what to write in a given spot. It’s the whole “Give a man a fish / Teach a man to fish” thing. At least try to figure out the code on your own, though. With a little bit of studying, it isn’t that hard to figure out what’s going on - after all, there’s a reason why it’s called BASIC.
i tried using the program you gave me the link to
but i didn’t get to test it because of batteries
i’ll have to pick up sommore of them
and iv been trying to study about
the ps2 controller but i think that i finnally got it
i still have to learn a little more about programing
though
hi,
I just realized I had an old PSone controller. Can I use it as if it was a PS2 controller?
And BTW, since I live in France and shipping is expensive, do you think I could just cut the cable of the controller instead of getting a controller cable from Lynx ?
But maybe I could ask to add it since my order is still pending…
thanks,
bietz
yep that would work fine.
well…
I wanted to try using the PSone controller for my BS2 BOE-bot:
I just cut the cable of the controller and tried to remove the plastic on all the colored wires… they are really thin and fragile! and it isn’t just copper but there is a kind of plastic filaments ins each (I think it’s to make the cable smooth).
But I can’t get to fit them into the BOE-bot’s breadboard…
Any suggestions? soldering?
I think I should move to PS2 controller section, should I?