PS2-BA

I think I finally understand how to program the Basic Atom to work with the PS2 controller, but how do I know which bits of a variable go to which buttons? Do I have to figure it out by a program to output to the debug screen and do something when I press a certain button?

Here you go… It’s all in there.
lynxmotion.com/images/html/build034.htm

Thanks! that’s what I needed.

What is the “'PS2Init” part of the program? is this part required? and how how do I know what values to enter?

[code]
;PS2Init
high CLK

low SEL
shiftout CMD,CLK,FASTLSBPRE,$1\8,$43\8,$0\8,$1\8,$0\8] ;CONFIG_MODE_ENTER
high SEL
pause 1

low SEL
shiftout CMD,CLK,FASTLSBPRE,$01\8,$44\8,$00\8,$01\8,$03\8,$00\8,$00\8,$00\8,$00\8] ;SET_MODE_AND_LOCK
high SEL
pause 100

low SEL
shiftout CMD,CLK,FASTLSBPRE,$01\8,$4F\8,$00\8,$FF\8,$FF\8,$03\8,$00\8,$00\8,$00\8] ;SET_DS2_NATIVE_MODE
high SEL
pause 1

low SEL
shiftout CMD,CLK,FASTLSBPRE,$01\8,$4D\8,$00\8,$00\8,$01\8,$FF\8,$FF\8,$FF\8,$FF\8] ;VIBRATION_ENABLE
high SEL
pause 1

low SEL
shiftout CMD,CLK,FASTLSBPRE,$01\8,$43\8,$00\8,$00\8,$5A\8,$5A\8,$5A\8,$5A\8,$5A\8] ;CONFIG_MODE_EXIT_DS2_NATIVE
high SEL
pause 1

low SEL
shiftout CMD,CLK,FASTLSBPRE,$01\8,$43\8,$00\8,$00\8,$00\8,$00\8,$00\8,$00\8,$00\8] ;CONFIG_MODE_EXIT
high SEL
pause 1[/code]

It puts the remote into analog mode. You need it…

Another question, it doesn’t state in the tutorial whether or not to connect the 5V jumper. Should I connect it?

The PS2 receiver plugs into the PS2C cable, and the cable has a plug that needs to be connected to 5vdc.

I have been trying to get it to work, but when I hit connect it outputs nothing but “255 255 255 255…etc.” and the receiver doesn’t light up either.

The transmitter and receiver should “connect” even with the Atom removed from the Bot Board. Look at the receivers powering. The LED’s should blink on the receiver before connecting.

OK, I got it to blink when its in debug mode, but it doesn’t connect to the controller. And it only blinks when in debug mode and I hit the “Run” button.

Try connecting it to a PS console. Like I said before, the transmitter and receiver will connect to each other even with the Atom removed completely from the Bot Board. Your message has too many it’s in it to be understood. At least for me… :frowning: Also we don’t use debug, we use the terminal windows at the bottom of the IDE. And the goal is to have the LED’s light steady, not to blink.

Sorry, I’ll try to be more specific.

What I am saying is that, the controller, won’t connect to the controller Receiver, and I don’t have a PS2 console. Does it matter if I have the SSC-32 hooked up to the Bot-Board too, because all the electronics are on 1 battery and it could draw a lot of power maybe? Also, I don’t have any new AAA batteries atm but it might also be that the batteries in the remote are almost dead and can’t connect to the receiver.

I’m ok with waiting till you source some good batteries. :wink:

lol yeah, I guess i should get some first. :unamused:

Ok, I have an update here…

I took the four screws off the receiver to take a look at it, and I was going to measure the voltage of some components. And as I turned the receiver on it all the sudden connected to my controller! I have absolutely NO cluse what I did, what I’m just glad its working now. Maybe one of the screws was shorting it out or something?