PS2 IR Codes

I was trying to find the IR codes for the PS2 dvd remote control, but after a little research, I found these.

X – 0x7AB5B
O – 0xBAB5B
triangle – 0x3AB5B
square – 0xFAB5B
up – 0x9EB5B
down – 0x5EB92
left – 0xDEB92
right – 0x3EB92
L1 – 0x5AB92
L2 – 0x1AB5B
L3 – 0x8AB5B
R1 – 0xDAB5B
R2 – 0x9AB5B
R3 – 0x4AB5B
start – 0xCAB5B
select – 0xAB5B

DVD remote commands

Play – 0x4CB92
Pause – 0x9CB92
Stop – 0x1CB92

The codes are 20 bit sony codes, so can be used with the arduino IRlibrary by this command:

irsend.sendSony(0xXXXXX, 20);

The codes need to be sent twice with a 10ms pause in between the commands.

Hopefully this will help whoever to do what they want with thier projects. I thought about using this with an old psx gamepad and using a atmega328 and battery to make it wireless through IR for the ps2 since they dont have the joysticks anyhow.

Advertisements

Hex to Decimal Python Program

Here’s a clip of code to convert either a hex to decimal value, or decimal to hex.

copied from here:

http://www.daniweb.com/software-development/python/code/216638/hexadecimal-to-decimal-python

Just modify it for your needs, and it’ll help with sending the commands from the Robosapien arduino library.


# change a hexadecimal string to decimal number and reverse
# check two different representations of the hexadecimal string
# negative values and zero are accepted
# tested with Python24 vegaseat 11oct2005
def dec2hex(n):
  """return the hexadecimal string representation of integer n"""
  return "%X" % n
def hex2dec(s):
  """return the integer value of a hexadecimal string s"""
  return int(s, 16)
print "dec2hex(255) =", dec2hex(255) # FF
print "hex2dec('FF') =", hex2dec('FF') # 255
print
print "hex(255) =", hex(255) # 0xff
print "hex2dec('0xff') =", hex2dec('0xff') # 255