Author Topic: Axon PS2 Controller Interface Library  (Read 3936 times)

0 Members and 1 Guest are viewing this topic.

Offline JadeKnightTopic starter

  • Jr. Member
  • **
  • Posts: 8
  • Helpful? 0
Axon PS2 Controller Interface Library
« on: September 28, 2009, 09:34:40 AM »
I uploaded a library (.h and .c file) to interface with a PS2 controller using an Axon MCU. It should work with any AVR based MCU, though, with some minor modifications.

The low level PS2 communication code was adapted from 'Dunk's tutorial.
http://www.societyofrobots.com/member_tutorials/node/200

Features:

    * Configurable pin assignments (uses 4 or 5 I/O pins, and 5v regulated power).
    * Supports connecting/disconnecting the controller at any time.
    * Detecting analog vs. digital mode.
    * Forcing analog mode on controller.
    * Easy access to all buttons and axes (axes can be raw, or with a simple deadzone).
    * Currently tested to work with a genuine Sony PS2 wired controller (any other brands/types *may* require some tweaking of the low-level communication code).


Download Link:
    http://forums.trossenrobotics.com/datacenter/drivers-libraries-firmware-7/axon-ps2-controller-interface-library-144/

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Axon PS2 Controller Interface Library
« Reply #1 on: February 23, 2010, 05:42:59 AM »
hey JadeKnight,
good work!
apologies it's been so long since you posted, i've been away.

with this you've done 2 out of the 3 things i always meant to go back and do to my code.
ie, get the acknowledge pin working and tidy up the code and put everything in easy to include functions.

do you mind if i edit the original tutorial to link to your post @ Trossen?
pointless people hacking away with my code when you've already completed the job.


the 3rd thing i always intended to do with this was use the hardware SPI module instead of bit-banging.
i failed when i tried this before but i've a better understanding of the SPI module in AVRs now.
i'll get round to that one day.


dunk.

 


Get Your Ad Here