Mindstorms 3rd Party ROBOTC Drivers RobotC
[Home] [Download] [Submit a bug/suggestion] [ROBOTC Forums] [Blog] [Support this project]
Data Structures | Defines | Functions | Variables

mindsensors-ps2ctrl-v4.h File Reference

Playstation 2 Controller Sensor. More...

#include "common.h"

Go to the source code of this file.

Data Structures

struct  tPSP

Defines

#define PSPV4_I2C_ADDR   0x02
#define PSPV4_REG_CMD   0x41
#define PSPV4_CMD_INITIALISE   0x49
#define PSPV4_REG_BTN_SET_1   0x42
#define PSPV4_REG_BTN_SET_2   0x43
#define PSPV4_REG_JLEFT   0x44
#define PSPV4_REG_JRIGHT   0x46
#define PSPV4_REG_PRES_JPAD_UP   0x4A
#define PSPV4_REG_PRES_JPAD_RIGHT   0x4B
#define PSPV4_REG_PRES_JPAD_DOWN   0x4C
#define PSPV4_REG_PRES_JPAD_LEFT   0x4D
#define PSPV4_REG_PRES_BTN_L2   0x4E
#define PSPV4_REG_PRES_BTN_R2   0x4F
#define PSPV4_REG_PRES_BTN_L1   0x50
#define PSPV4_REG_PRES_BTN_R1   0x51
#define PSPV4_REG_PRES_BTN_TRIANGLE   0x52
#define PSPV4_REG_PRES_BTN_SQUARE   0x53
#define PSPV4_REG_PRES_BTN_CIRCLE   0x54
#define PSPV4_REG_PRES_BTN_CROSS   0x55
#define PSPV4_REG_REF_SIGNAL_CODE   0x56
#define PSPV4_REG_REF_TX_TYPE   0x57
#define PSPV4_REG_REF_SIGNAL_RAW   0x58
#define PSPV4_REG_REF_SIGNAL_COUNT   0x5C
#define PSPV4_SIGNAL_FAST_REWIND   0x32
#define PSPV4_SIGNAL_FAST_FORWARD   0x34
#define PSPV4_SIGNAL_PLAY   0x35
#define PSPV4_SIGNAL_STOP   0x36

Functions

bool _PSPV4init (tSensors link, ubyte address=PSPV4_I2C_ADDR)
ubyte _PSPV4readByte (tSensors link, ubyte reg, ubyte address=PSPV4_I2C_ADDR)
bool PSPV4readButtons (tSensors link, tPSP &controllerState, ubyte address=PSPV4_I2C_ADDR)
bool PSPV4readButtonPressure (tSensors link, tPSP &controllerState, ubyte address=PSPV4_I2C_ADDR)
byte PSPV4readRefSignal (tSensors link, ubyte address=PSPV4_I2C_ADDR)
byte PSPV4readRefSignalCount (tSensors link, ubyte address=PSPV4_I2C_ADDR)
byte PSPV4readRefTXType (tSensors link, ubyte address=PSPV4_I2C_ADDR)
long PSPV4readRawRefTXValue (tSensors link, ubyte address=PSPV4_I2C_ADDR)

Variables

tByteArray PSPV4_I2CRequest
tByteArray PSPV4_I2CReply
bool PSPV4initalised [4] = {false, false, false, false}
tPSP pspController

Detailed Description

Playstation 2 Controller Sensor.

mindsensors-ps2ctrl-v4.h provides an API for the Mindsensors PS2 controller sensor with referee signal receiver.

Changelog:

Credits:

License: You may use this code as you wish, provided you give credit where its due.

THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 3.59 AND HIGHER.

Author:
Xander Soldaat (xander_at_botbench.com)
Date:
30 July 2012
Version:
0.1

Definition in file mindsensors-ps2ctrl-v4.h.