Keywish Hummer-Bot-2.0 Instruction Manual page 105

Table of Contents

Advertisement

3.2.7.3 Software Design
#include "PS2X_lib.h"
/******************************************************************
* set pins connected to PS2 controller:
*
- 1e column: original
*
- 2e colmun: Stef?
* replace pin numbers by the ones you use
******************************************************************/
#define PS2_DAT
#define PS2_CMD
#define PS2_SEL
#define PS2_CLK
/******************************************************************
* select modes of PS2 controller:
*
- pressures = analog reading of push-butttons
*
- rumble
= motor rumbling
* uncomment 1 of the lines for each mode selection
******************************************************************/
//#define pressures
#define pressures
//#define rumble
#define rumble
PS2X
ps2x;
// create PS2 Controller Class
//right now, the library does NOT support hot pluggable controllers, meaning
//you must always either restart your Arduino after you connect the controller,
//or call config_gamepad(pins) again after connecting the controller.
int
error
= 0;
byte type
= 0;
byte vibrate
= 0;
// Reset func
void
(* resetFunc) (void) = 0;
//for v1.6
4
7
8
11
true
false
true
false
102

Advertisement

Table of Contents
loading

Related Products for Keywish Hummer-Bot-2.0

Table of Contents