2 Example sketch for the Playstation Buzz library - developed by Kristian Lauszus
3 For more information visit my blog: http://blog.tkjelectronics.dk/ or
4 send me an e-mail: kristianl@tkjelectronics.com
9 // Satisfy the IDE, which needs to see the include statment in the ino too.
11 #include <spi4teensy3.h>
20 #if !defined(__MIPSEL__)
21 while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
23 if (Usb.Init() == -1) {
24 Serial.print(F("\r\nOSC did not start"));
27 Serial.println(F("\r\nPS Buzz Library Started"));
33 if (Buzz.connected()) {
34 for (uint8_t i = 0; i < 4; i++) {
35 if (Buzz.getButtonClick(RED, i)) {
36 Buzz.setLedToggle(i); // Toggle the LED
37 Serial.println(F("RED"));
39 if (Buzz.getButtonClick(YELLOW, i))
40 Serial.println(F("YELLOW"));
41 if (Buzz.getButtonClick(GREEN, i))
42 Serial.println(F("GREEN"));
43 if (Buzz.getButtonClick(ORANGE, i))
44 Serial.println(F("ORANGE"));
45 if (Buzz.getButtonClick(BLUE, i))
46 Serial.println(F("BLUE"));