Arduino-PS2X icon indicating copy to clipboard operation
Arduino-PS2X copied to clipboard

Wrong Arduino pin assignment in example code: PS2X_Example.ino

Open Discussion-008 opened this issue 3 years ago • 0 comments

https://github.com/madsci1016/Arduino-PS2X/blob/master/PS2X_lib/examples/PS2X_Example/PS2X_Example.ino

In the example code, the following mapping is shown (line 9 - 12):

#define PS2_DAT 13 //14
#define PS2_CMD 11 //15 #define PS2_SEL 10 //16 #define PS2_CLK 12 //17

This is to my understanding wrong for Arduino Uno R3. What is shown on the official pinout page: https://content.arduino.cc/assets/Pinout-UNOrev3_latest.pdf

Should map to:

#define PS2_DAT 12 // D12 -> Controller In, Peripheral Out (CIPO) - The Peripheral line for sending data to the Controller (Arduino)
#define PS2_CMD 11 // D11 -> Controller Out Peripheral In (COPI) -> Commands from Controller to Peripheral (PS2 controller) #define PS2_SEL 10 // D10 -> SS Slave Select #define PS2_CLK 13 // D13 -> SCK Serial Clock

If I am correct, this might confuse users of the example code, even so it is commented with: replace pin numbers by the ones you use

Discussion-008 avatar May 22 '22 14:05 Discussion-008