ReadME.txt 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /******************************************************************
  2. * Super amazing PS2 controller Arduino Library v1.8
  3. * details and example sketch:
  4. * http://www.billporter.info/?p=240
  5. *
  6. * Original code by Shutter on Arduino Forums
  7. *
  8. * Revamped, made into lib by and supporting continued development:
  9. * Bill Porter
  10. * www.billporter.info
  11. *
  12. * Contributers:
  13. * Eric Wetzel (thewetzel@gmail.com)
  14. * Kurt Eckhardt
  15. *
  16. * Lib version history
  17. * 0.1 made into library, added analog stick support.
  18. * 0.2 fixed config_gamepad miss-spelling
  19. * added new functions:
  20. * NewButtonState();
  21. * NewButtonState(unsigned int);
  22. * ButtonPressed(unsigned int);
  23. * ButtonReleased(unsigned int);
  24. * removed 'PS' from begining of ever function
  25. * 1.0 found and fixed bug that wasn't configuring controller
  26. * added ability to define pins
  27. * added time checking to reconfigure controller if not polled enough
  28. * Analog sticks and pressures all through 'ps2x.Analog()' function
  29. * added:
  30. * enableRumble();
  31. * enablePressures();
  32. * 1.1
  33. * added some debug stuff for end user. Reports if no controller found
  34. * added auto-increasing sentence delay to see if it helps compatibility.
  35. * 1.2
  36. * found bad math by Shutter for original clock. Was running at 50kHz, not the required 500kHz.
  37. * fixed some of the debug reporting.
  38. * 1.3
  39. * Changed clock back to 50kHz. CuriousInventor says it's suppose to be 500kHz, but doesn't seem to work for everybody.
  40. * 1.4
  41. * Removed redundant functions.
  42. * Fixed mode check to include two other possible modes the controller could be in.
  43. * Added debug code enabled by compiler directives. See below to enable debug mode.
  44. * Added button definitions for shapes as well as colors.
  45. * 1.41
  46. * Some simple bug fixes
  47. * Added Keywords.txt file
  48. * 1.5
  49. * Added proper Guitar Hero compatibility
  50. * Fixed issue with DEBUG mode, had to send serial at once instead of in bits
  51. * 1.6
  52. * Changed config_gamepad() call to include rumble and pressures options
  53. * This was to fix controllers that will only go into config mode once
  54. * Old methods should still work for backwards compatibility
  55. * 1.7
  56. * Integrated Kurt's fixes for the interrupts messing with servo signals
  57. * Reorganized directory so examples show up in Arduino IDE menu
  58. * 1.8
  59. * Added Arduino 1.0 compatibility.
  60. *
  61. *
  62. *This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
  63. This program is distributed in the hope that it will be useful,
  64. but WITHOUT ANY WARRANTY; without even the implied warranty of
  65. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  66. GNU General Public License for more details.
  67. <http://www.gnu.org/licenses/>
  68. *
  69. ******************************************************************/
  70. To install, unzip and place 'PS2X_lib' folder into your 'C:\Users\{user name}\Documents\Arduino\libraries' folder or '{Arduino IDE path}\hardware\libraries" or {Arduino IDE path}\libraries" directory.
  71. Restart the Arduino IDE, and open up the example sketch.
  72. All uses of the library are in the example sketch.
  73. ****************IF YOU HAVE PROBLEMS***********************
  74. open up the PS2X_lib.h file and change (remove the comment markers)
  75. // $$$$$$$$$$$$ DEBUG ENABLE SECTION $$$$$$$$$$$$$$$$
  76. // to debug ps2 controller, uncomment these two lines to print out debug to uart
  77. //#define PS2X_DEBUG
  78. //#define PS2X_COM_DEBUG
  79. to
  80. // $$$$$$$$$$$$ DEBUG ENABLE SECTION $$$$$$$$$$$$$$$$
  81. // to debug ps2 controller, uncomment these two lines to print out debug to uart
  82. #define PS2X_DEBUG
  83. #define PS2X_COM_DEBUG
  84. to enable debug messages. Save the file, and recompile the example sketch. Open up the terminal
  85. and watch what is written. If the problem is not something obvious, dump the serial output into a comment on my website and I will try
  86. to help you.
  87. Report all bugs and check for updates at:
  88. http://www.billporter.info/?p=240
  89. Enjoy.