Okay, I'm doing better. I got the code onto the board, the problem was the file folder like you suggested. My new problem is this: Where do I attatch the Ack wire from the controller? I can't seem to find the answer to that. And I may need to change what pin # it is, for the Mega. What line of code dictates the Ack pin?

Also, I want to change the pins for Data, Attn, Clk, and Comand too. Am I right to change it in this line of code: error = ps2x.config_gamepad(13,11,10,12, true, true); //setup pins and settings: GamePad(clock, command, attention, data, Pressures?, Rumble?) check for error

I am very new to Arduino. I am a mechanical engineering student and my only programming background is in MATLAB. I am working on a Senior Design project involving control of a 40lb tank robot using a wireless PS2 controller from Lynxmotion.

I have downloaded your library and looked through its capabilities. It is very impressive. It has more than enough functionality for my purposes, specifically the ability to control 3 DC motors with bidirectional speed control.

I was hoping that you could indicate to me how to read the joystick values from your library into a PWM signal. I really appreciate the help.

Edit: the best I can infer is using if ps2x.Button(RSS_RX) to read a value and then based on that using analogWrite(pin,scale)

Thank you,John

Also I would like to clarify this point: I prefer to have pins 10 and/or 11 available for PWM output, as pins 5 and 6 have known issues with low duty-cycle settings. "The PWM outputs generated on pins 5 and 6 will have higher-than-expected duty cycles. This is because of interactions with the millis() and delay() functions, which share the same internal timer used to generate those PWM outputs. This will be noticed mostly on low duty-cycle settings (e.g 0 - 10) and may result in a value of 0 not fully turning off the output on pins 5 and 6." Will there be any problems with using pins 5 and/or 6 based on this issue?