Please Help

Im new and I Error message

/Users/Grant/Downloads/ fatal error: Wire.h: No such file or directory
#include “Wire.h”
compilation terminated.
Multiple libraries were found for “EasyTransfer2.h”
Used: /Users/Grant/Downloads/
Not used: /Users/Grant/Downloads/
Error compiling.

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.#include <Arduino_LCD.h>


#include <ArduinoRobot.h>
#include <Compass.h>
#include <EasyTransfer2.h>
#include <EEPROM_I2C.h>
#include <Fat16.h>
#include <Fat16Config.h>
#include <Fat16mainpage.h>
#include <Fat16util.h>
#include <FatStructs.h>
#include <Multiplexer.h>
#include <SdCard.h>
#include <SdInfo.h>
#include <Squawk.h>
#include <SquawkSD.h>

#include <IRremote.h>
#include <IRremoteInt.h>
#include <IRremoteTools.h>

#include “PS2X_lib.h”
#include <math.h>
#include <stdio.h>
#include <stdint.h>
#include <avr/io.h>
#if ARDUINO > 22
#include “Arduino.h”
#include “WProgram.h”
#include “pins_arduino.h”

static byte enter_config={0x01,0x43,0x00,0x01,0x00};
static byte set_mode={0x01,0x44,0x00,0x01,0x03,0x00,0x00,0x00,0x00};
static byte set_bytes_large={0x01,0x4F,0x00,0xFF,0xFF,0x03,0x00,0x00,0x00};
static byte exit_config={0x01,0x43,0x00,0x00,0x5A,0x5A,0x5A,0x5A,0x5A};
static byte enable_rumble={0x01,0x4D,0x00,0x00,0x01};
static byte type_read={0x01,0x45,0x00,0x5A,0x5A,0x5A,0x5A,0x5A,0x5A};

boolean PS2X::NewButtonState() {
return ((last_buttons ^ buttons) > 0);


boolean PS2X::NewButtonState(unsigned int button) {
return (((last_buttons ^ buttons) & button) > 0);

boolean PS2X::ButtonPressed(unsigned int button) {
return(NewButtonState(button) & Button(button));

boolean PS2X::ButtonReleased(unsigned int button) {
return((NewButtonState(button)) & ((~last_buttons & button) > 0));

boolean PS2X::Button(uint16_t button) {
return ((~buttons & button) > 0);

unsigned int PS2X::ButtonDataByte() {
return (~buttons);

byte PS2X::Analog(byte button) {
return PS2data[button];
unsigned char PS2X::_gamepad_shiftinout (char byte) {
uint8_t old_sreg = SREG; // *** KJE *** save away the current state of interrupts

unsigned char tmp = 0;
cli(); // *** KJE *** disable for now
for(i=0;i<8;i++) {

if(CHK(byte,i)) SET(_cmd_oreg,_cmd_mask);
else CLR(

SREG = old_sreg; // *** *** KJE *** *** Interrupts may be enabled again
cli(); // *** KJE ***

if(CHK(_dat_ireg,_dat_mask)) SET(tmp,i);
SREG = old_sreg; // *** *** KJE *** *** Interrupts may be enabled again
return tmp;

void PS2X::read_gamepad() {
read_gamepad(false, 0x00);

void PS2X::read_gamepad(boolean motor1, byte motor2) {
double temp = millis() - last_read;
uint8_t old_sreg = SREG; // *** KJE **** save away the current state of interrupts - *** *** KJE *** ***

if (temp > 1500) //waited to long

if(temp < read_delay) //waited too short
delay(read_delay - temp);

last_buttons = buttons; //store the previous buttons states

if(motor2 != 0x00)
motor2 = map(motor2,0,255,0x40,0xFF); //noting below 40 will make it spin

cli(); //*** KJE ***
CLR(*_att_oreg,_att_mask); // low enable joystick
SREG = old_sreg; // *** KJE *** - Interrupts may be enabled again

//Send the command to send button and joystick data;
char dword[9] = {0x01,0x42,0,motor1,motor2,0,0,0,0};
byte dword2[12] = {0,0,0,0,0,0,0,0,0,0,0,0};

for (int i = 0; i<9; i++) {
PS2data = gamepad_shiftinout(dword*);

if(PS2data[1] == 0x79) { //if controller is in full data return mode, get the rest of data
* for (int i = 0; i<12; i++) {*
PS2data[i+9] = gamepad_shiftinout(dword2*);*
* }

SET(_att_oreg,att_mask); // HI disable joystick
SREG = old_sreg; // Interrupts may be enabled again

for(int i=0; i<9; i++){_

_Serial.print(dword, HEX);

_Serial.print(PS2data, HEX);
Serial.print(" ");
for (int i = 0; i<12; i++) {_

_Serial.print(dword2, HEX);
Serial.print(PS2data[i+9], HEX);
Serial.print(" ");

buttons = (uint16_t)(PS2data+3); //store as one value for multiple functions
* last_read = millis();*
byte PS2X::config_gamepad(uint8_t clk, uint8_t cmd, uint8_t att, uint8_t dat) {
return config_gamepad(clk, cmd, att, dat, false, false);
byte PS2X::config_gamepad(uint8_t clk, uint8_t cmd, uint8_t att, uint8_t dat, bool pressures, bool rumble) {
uint8_t old_sreg = SREG; // *** KJE *** save away the current state of interrupts
* byte temp[sizeof(type_read)];
clk_mask = maskToBitNum(digitalPinToBitMask(clk));
clk_oreg = portOutputRegister(digitalPinToPort(clk));
cmd_mask = maskToBitNum(digitalPinToBitMask(cmd));
cmd_oreg = portOutputRegister(digitalPinToPort(cmd));
att_mask = maskToBitNum(digitalPinToBitMask(att));
att_oreg = portOutputRegister(digitalPinToPort(att));
dat_mask = maskToBitNum(digitalPinToBitMask(dat));
dat_ireg = portInputRegister(digitalPinToPort(dat));*
pinMode(clk, OUTPUT); //configure ports

pinMode(att, OUTPUT);

pinMode(cmd, OUTPUT);

pinMode(dat, INPUT);

digitalWrite(dat, HIGH); //enable pull-up_

_ cli(); // *** KJE *** disable for now_
SET(_cmd_oreg,_cmd_mask); // SET(_cmd_oreg,_cmd_mask);
SREG = old_sreg; // *** *** KJE *** *** Interrupts may be enabled again

* //new error checking. First, read gamepad a few times to see if it’s talking*
* read_gamepad();

* //see if it talked*
* if(PS2data[1] != 0x41 && PS2data[1] != 0x73 && PS2data[1] != 0x79){ //see if mode came back. If still anything but 41, 73 or 79, then it’s not talking*
* #ifdef PS2X_DEBUG*
Serial.println(“Controller mode not matched or no controller found”);
Serial.print("Expected 0x41 or 0x73, got ");
Serial.println(PS2data[1], HEX);
return 1; //return error code 1
//try setting mode, increasing delays if need be.
read_delay = 1;
for(int y = 0; y <= 10; y++)
* sendCommandString(enter_config, sizeof(enter_config)); //start config run*

* //read type*
* delayMicroseconds(CTRL_BYTE_DELAY);
_ cli(); // *** KJE *** disable for now_
CLR(att_oreg,att_mask); // low enable joystick
SREG = old_sreg; // *** *** KJE *** *** Interrupts may be enabled again
* delayMicroseconds(CTRL_BYTE_DELAY);*
* for (int i = 0; i<9; i++) {*

temp = gamepad_shiftinout(type_read*);*
* }*

I am a new guy myself.

Think you should have this

#include <Wire.h> //Note the usage of Greater than and Less than, not quotes.

Hope that helps


Welcome to the Forum. Please read the two posts at the top of this Forum by Nick Gammon on guidelines for posting here, especially the use of code tags ("</>") when posting source code files. Also, before posting the code, use Ctrl-T in the IDE to reformat the code in a standard format, which makes it easier for us to read.

@aarg: That looks familiar!! :slight_smile:

Also give your posts a meaningful topic!

"Please help" gives no indication of the subject matter that you want help with. Members will either open it to find out and then decide if they can help or not. Or, they could just ignore the post altogether.


It may be difficult to help you for the reason(s) indicated by a checked box (x) below:

() You have not clearly stated the problem that you are actually experiencing.
() Instead of your complete code, you have only provided snippets of code for analysis, thus presenting a Mensa puzzle.
() Your technical writing style is almost unintelligible (even though English is your native language).
() You obviously don't believe in reading standard manuals or online reference materials that have the answer to your question.
() You ask for help, but then act defensive or smug when the advice that is given contradicts your beliefs.
() You are presenting the work of others as if it is your own.
() You insist that you have a hardware problem when it is obviously a software problem.
() You insist that you have a software problem when it is obviously a hardware problem.
(x) Your very first program is 7,532 lines long and you just tested it for the first time because it always compiled correctly.
(x) Your 7,532 line program is full of undocumented magic numbers like 0x48383838929 and mysterious variables like lx, _foo89, and puppyChow.
(x) The control flow of your program would make Mr. Spock cry.
(x) You posted without reading any threads, including the first one, "How to use this forum - please read".
() Your question has nothing whatsoever to do with the forum subject category.
() You believe that the computer should understand what you meant, not what you wrote.
() After being repeatedly told exactly what to do to solve your problem, you still don't get it.