Arduino nano USB host

I bought an USB host for the arduino nano (from here)

And I would like to use a PS3 controller (via a dongle) with this arduino, but I think the code for the USB Host Shield Library does not use the same pins as the Nano host shield does, how would I go about editing the pins in this huge library? I looked around for a while but found nothing relevant.

God, what a dreadful library to have to dig through.

I took a quick look through library source, I couldn't figure out where they make their choice about what pins to use either. I think only one pin needs to be changed, and that is the slave select pin, which is on D8 instead of D10.

DrAzzy:
God, what a dreadful library to have to dig through.

I took a quick look through library source, I couldn't figure out where they make their choice about what pins to use either. I think only one pin needs to be changed, and that is the slave select pin, which is on D8 instead of D10.

Do you know any better way to establish communication with bluetooth? I'll look into the library but if you know anything it would be nice to know.

DrAzzy:
God, what a dreadful library to have to dig through.

I took a quick look through library source, I couldn't figure out where they make their choice about what pins to use either. I think only one pin needs to be changed, and that is the slave select pin, which is on D8 instead of D10.

Found a better library but haven't tested yet, found the pin here as MAX_SS on 10, will try this later.
USB-Host/ps3/PS3USB at master · ribbotson/USB-Host · GitHub

EDIT: This is for USB cable only, no BT

I looked around in the first repo linked and tried finding the slave setup pin but the only relevant code I find is in the file avrpins.h

#define MAKE_PIN(className, pin) \
class className { \
public: \
  static void Set() { \
    digitalWrite(pin, HIGH);\
  } \
  static void Clear() { \
    digitalWrite(pin, LOW); \
  } \
  static void SetDirRead() { \
    pinMode(pin, INPUT); \
  } \
  static void SetDirWrite() { \
    pinMode(pin, OUTPUT); \
  } \
  static uint8_t IsSet() { \
    return digitalRead(pin); \
  } \
};

// 0 .. 13 - Digital pins
MAKE_PIN(P0, 0); // RX
MAKE_PIN(P1, 1); // TX
MAKE_PIN(P2, 2); //
MAKE_PIN(P3, 3); //
MAKE_PIN(P4, 4); //
MAKE_PIN(P5, 5); //
MAKE_PIN(P6, 6); //
MAKE_PIN(P7, 7); //
MAKE_PIN(P8, 8); //
MAKE_PIN(P9, 9); //
MAKE_PIN(P10, 10); //
MAKE_PIN(P11, 11); //
MAKE_PIN(P12, 12); //
MAKE_PIN(P13, 13); //

#undef MAKE_PIN

and

#define MAKE_PIN(className, baseReg, pinNum, configReg) \
class className { \
public: \
  static void Set() { \
    *GPIO_BITBAND_PTR(baseReg, pinNum) = 1; \
  } \
  static void Clear() { \
    *GPIO_BITBAND_PTR(baseReg, pinNum) = 0; \
  } \
  static void SetDirRead() { \
    configReg = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1); \
    *(GPIO_BITBAND_PTR(baseReg, pinNum) + 640) = 0; \
  } \
  static void SetDirWrite() { \
    configReg = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1); \
    *(GPIO_BITBAND_PTR(baseReg, pinNum) + 640) = 1; \
  } \
  static uint8_t IsSet() { \
    return *(GPIO_BITBAND_PTR(baseReg, pinNum) + 512); \
  } \
};

MAKE_PIN(P0, CORE_PIN0_PORTREG, CORE_PIN0_BIT, CORE_PIN0_CONFIG);
MAKE_PIN(P1, CORE_PIN1_PORTREG, CORE_PIN1_BIT, CORE_PIN1_CONFIG);
MAKE_PIN(P2, CORE_PIN2_PORTREG, CORE_PIN2_BIT, CORE_PIN2_CONFIG);
MAKE_PIN(P3, CORE_PIN3_PORTREG, CORE_PIN3_BIT, CORE_PIN3_CONFIG);
MAKE_PIN(P4, CORE_PIN4_PORTREG, CORE_PIN4_BIT, CORE_PIN4_CONFIG);
MAKE_PIN(P5, CORE_PIN5_PORTREG, CORE_PIN5_BIT, CORE_PIN5_CONFIG);
MAKE_PIN(P6, CORE_PIN6_PORTREG, CORE_PIN6_BIT, CORE_PIN6_CONFIG);
MAKE_PIN(P7, CORE_PIN7_PORTREG, CORE_PIN7_BIT, CORE_PIN7_CONFIG);
MAKE_PIN(P8, CORE_PIN8_PORTREG, CORE_PIN8_BIT, CORE_PIN8_CONFIG);
MAKE_PIN(P9, CORE_PIN9_PORTREG, CORE_PIN9_BIT, CORE_PIN9_CONFIG);
MAKE_PIN(P10, CORE_PIN10_PORTREG, CORE_PIN10_BIT, CORE_PIN10_CONFIG);
MAKE_PIN(P11, CORE_PIN11_PORTREG, CORE_PIN11_BIT, CORE_PIN11_CONFIG);
MAKE_PIN(P12, CORE_PIN12_PORTREG, CORE_PIN12_BIT, CORE_PIN12_CONFIG);
MAKE_PIN(P13, CORE_PIN13_PORTREG, CORE_PIN13_BIT, CORE_PIN13_CONFIG);
MAKE_PIN(P14, CORE_PIN14_PORTREG, CORE_PIN14_BIT, CORE_PIN14_CONFIG);
MAKE_PIN(P15, CORE_PIN15_PORTREG, CORE_PIN15_BIT, CORE_PIN15_CONFIG);
MAKE_PIN(P16, CORE_PIN16_PORTREG, CORE_PIN16_BIT, CORE_PIN16_CONFIG);
MAKE_PIN(P17, CORE_PIN17_PORTREG, CORE_PIN17_BIT, CORE_PIN17_CONFIG);
MAKE_PIN(P18, CORE_PIN18_PORTREG, CORE_PIN18_BIT, CORE_PIN18_CONFIG);
MAKE_PIN(P19, CORE_PIN19_PORTREG, CORE_PIN19_BIT, CORE_PIN19_CONFIG);
MAKE_PIN(P20, CORE_PIN20_PORTREG, CORE_PIN20_BIT, CORE_PIN20_CONFIG);
MAKE_PIN(P21, CORE_PIN21_PORTREG, CORE_PIN21_BIT, CORE_PIN21_CONFIG);
MAKE_PIN(P22, CORE_PIN22_PORTREG, CORE_PIN22_BIT, CORE_PIN22_CONFIG);
MAKE_PIN(P23, CORE_PIN23_PORTREG, CORE_PIN23_BIT, CORE_PIN23_CONFIG);
MAKE_PIN(P24, CORE_PIN24_PORTREG, CORE_PIN24_BIT, CORE_PIN24_CONFIG);
MAKE_PIN(P25, CORE_PIN25_PORTREG, CORE_PIN25_BIT, CORE_PIN25_CONFIG);
MAKE_PIN(P26, CORE_PIN26_PORTREG, CORE_PIN26_BIT, CORE_PIN26_CONFIG);
MAKE_PIN(P27, CORE_PIN27_PORTREG, CORE_PIN27_BIT, CORE_PIN27_CONFIG);
MAKE_PIN(P28, CORE_PIN28_PORTREG, CORE_PIN28_BIT, CORE_PIN28_CONFIG);
MAKE_PIN(P29, CORE_PIN29_PORTREG, CORE_PIN29_BIT, CORE_PIN29_CONFIG);
MAKE_PIN(P30, CORE_PIN30_PORTREG, CORE_PIN30_BIT, CORE_PIN30_CONFIG);
MAKE_PIN(P31, CORE_PIN31_PORTREG, CORE_PIN31_BIT, CORE_PIN31_CONFIG);
MAKE_PIN(P32, CORE_PIN32_PORTREG, CORE_PIN32_BIT, CORE_PIN32_CONFIG);
MAKE_PIN(P33, CORE_PIN33_PORTREG, CORE_PIN33_BIT, CORE_PIN33_CONFIG);

#undef MAKE_PIN

I'm desperatly trying to find a better library purely for ps3 bluetooth as it seems this library just has everything mashed into 1 folder

You can get a bluetooth to serial module.

ChilliTronix:
You can get a bluetooth to serial module.

This looks like a good solution!
Can you recommend one? I found alot of them on google but I'd rather not buy another electronic component
like this

but just a converter that I can plug into the usb slot, I only manage to find ones with the serial port instead of usb.

For a nano you would use a serial one, and use a USB one on the computer side.

ChilliTronix:
For a nano you would use a serial one, and use a USB one on the computer side.

The plan is to connect a ps3 controller, no computer involved.

I can't attach the bluetooth to serial converters I find because they have a serial port and the serial port doesn't fit on the arduino nano shield USB slot.

I found one here but it says it has a HC-06 Master, but HC-06 only has firmware for slave, so a bit sceptic about this one.

Ah I see. For the most part they are used as slaves, and they connect directly to the nano.

I have no idea how you would connect to a PS2 controller.

ChilliTronix:
Ah I see. For the most part they are used as slaves, and they connect directly to the nano.

I have no idea how you would connect to a PS2 controller.

PS3 using bluetooth, not PS2

And HC-06 can only be used as slaves, so not sure why they would specify it's a master, I would've bought that if it weren't for the sketchy description.