You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Source: http://www.developerfusion.com/article/84338/making-usb-c-friendly/ and https://github.com/torvalds/linux/blob/master/drivers/hid/hid-sony.c
* Used to call your own function when the device is successfully initialized.
64
+
* @param funcOnInit Function to call.
65
+
*/
66
+
voidattachOnInit(void (*funcOnInit)(void)) {
67
+
pFuncOnInit = funcOnInit;
68
+
};
69
+
70
+
/** @name PS Buzzer Controller functions */
71
+
/**
72
+
* getButtonPress(ButtonEnum b) will return true as long as the button is held down.
73
+
*
74
+
* While getButtonClick(ButtonEnum b) will only return it once.
75
+
*
76
+
* So you instance if you need to increase a variable once you would use getButtonClick(ButtonEnum b),
77
+
* but if you need to drive a robot forward you would use getButtonPress(ButtonEnum b).
78
+
* @param b ::ButtonEnum to read.
79
+
* @param controller The controller to read from. Default to 0.
80
+
* @return getButtonPress(ButtonEnum b) will return a true as long as a button is held down, while getButtonClick(ButtonEnum b) will return true once for each button press.
* Developer of the [BTD](#bluetooth-libraries), [BTHID](#bthid-library), [SPP](#spp-library), [PS4](#ps4-library), [PS3](#ps3-library), [Wii](#wii-library), and [Xbox](#xbox-library) libraries
25
+
* Developer of the [BTD](#bluetooth-libraries), [BTHID](#bthid-library), [SPP](#spp-library), [PS4](#ps4-library), [PS3](#ps3-library), [Wii](#wii-library), [Xbox](#xbox-library), and [PSBuzz](#ps-buzz-library) libraries
26
26
*__Andrew Kroll__ - <xxxajk@gmail.com>
27
27
* Major contributor to mass storage code
28
28
29
+
# Table of Contents
30
+
31
+
*[How to include the library](#how-to-include-the-library)
32
+
*[How to use the library](#how-to-use-the-library)
* The old library created by _Tomoyuki Tanaka_: <https://github.com/moyuchin/WiiRemote_on_Arduino> also helped a lot.
243
263
264
+
### [PS Buzz Library](PSBuzz.cpp)
265
+
266
+
This library implements support for the Playstation Buzz controllers via USB.
267
+
268
+
It is essentially just a wrapper around the [HIDUniversal](hiduniversal.cpp) which takes care of the initializing and reading of the controllers. The [PSBuzz](PSBuzz.cpp) class simply inherits this and parses the data, so it is easy for users to read the buttons and turn the big red button on the controllers on and off.
269
+
270
+
The example [PSBuzz.ino](examples/PSBuzz/PSBuzz.ino) shows how one can do this with just a few lines of code.
271
+
272
+
More information about the controller can be found at the following sites:
The shield is using SPI for communicating with the MAX3421E USB host controller. It uses the SCK, MISO and MOSI pins via the ICSP on your board.
280
+
281
+
Furthermore it uses one pin as SS and one INT pin. These are by default located on pin 10 and 9 respectively. They can easily be reconfigured in case you need to use them for something else by cutting the jumper on the shield and then solder a wire from the pad to the new pin.
282
+
283
+
After that you need modify the following entry in [UsbCore.h](UsbCore.h):
284
+
285
+
```C++
286
+
typedef MAX3421e<P10, P9> MAX3421E;
287
+
```
288
+
289
+
For instance if you have rerouted SS to pin 7 it should read:
290
+
291
+
```C++
292
+
typedef MAX3421e<P7, P9> MAX3421E;
293
+
```
294
+
295
+
See the "Interface modifications" section in the [hardware manual](https://www.circuitsathome.com/usb-host-shield-hardware-manual) for more information.
296
+
244
297
# FAQ
245
298
246
299
> When I plug my device into the USB connector nothing happens?
0 commit comments