Unojoy - Xbox 360 Wireless Reciever to Unojoy (PS3)

Hello friends,
I was reading about how unojoy can be used as a controller for the playstation 3, since i dont have any controllers for the ps3 and don't want to waste $50 on getting a controller, i thought of using my xbox 360 controller as the controller for the ps3 by using a usb host shield and a wireless reciever (the one used for pc:

)
Basically the if i press A on the xbox 360 controller -> to usb host shield -> arduino, converts command for ps3 -> ps3 accepts A as X button pressed
ive started (http://pastebin.com/QTVU6ujR) but i do not know how to link a command to another command, such as If i press A on the xbox 360 controller, it will equal to X as the command sent to the ps3 and im getting errors, i am totally confused

any help would be appreciated