ArduinoとJQ6500の接続はスケッチの内容を確認。 JQ6500のTX(10pin)をArduinoの8pinに、 JQ6500のRX(9pin)をArduinoの9pinに1kΩを介して接続します。 // Arduino Pin 8 is connected to TX of the JQ6500 // Arduino Pin 9 is connected to one end of a 1k resistor, // the other end of the 1k resistor is connected to RX of the JQ6500 // If your Arduino is 3v3 powered, you can omit the 1k series resistor SoftwareSerial mySerial(8, 9); JQ6500_Serial mp3(mySerial);
/* You can create the instance of the PS4BT class in two ways */ // This will start an inquiry and then pair with the PS4 controller - you only have to do this once // You will need to hold down the PS and Share button at the same time, the PS4 controller will then start to blink rapidly indicating that it is in pairing mode PS4BT PS4(&Btd, PAIR);
// After that you can simply create the instance like so and then press the PS button on the device //PS4BT PS4(&Btd);
【変更後】
/* You can create the instance of the PS4BT class in two ways */ // This will start an inquiry and then pair with the PS4 controller - you only have to do this once // You will need to hold down the PS and Share button at the same time, the PS4 controller will then start to blink rapidly indicating that it is in pairing mode //PS4BT PS4(&Btd, PAIR);
// After that you can simply create the instance like so and then press the PS button on the device PS4BT PS4(&Btd);
Serial.begin(115200); while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection if (Usb.Init() == -1) { Serial.print(F("\r\nOSC did not start")); while (1); //halt } Serial.print(F("\r\nPS3 Bluetooth Library Started")); }
//砲撃 + リコイル if (PS3.getButtonClick(R1) && ch == 0 ) { int khz = 38; // 38kHz carrier frequency for the NEC protocol unsigned int irSignal[] = {4100, 1000, 2000, 2050, 1000}; // vs BATTLE TANK jr T-72 40MHz // AnalysIR Batch Export (IRremote) - RAW irsend.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), khz);
myservo.attach(46); //servo ピン46 (9-11ピンは使えない。) myservo_1.attach(44); //servo_1 ピン44 myservo.write(servo_pos); myservo_1.write(servo_pos); Serial.begin(115200); while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection if (Usb.Init() == -1) { Serial.print(F("\r\nOSC did not start")); while (1); //halt } Serial.print(F("\r\nPS3 Bluetooth Library Started")); }
//砲撃 + リコイル動作 + 赤外線砲撃信号発光 if (PS3.getButtonClick(R1) && ch == 0 ) { int khz = 38; // 38kHz carrier frequency for the NEC protocol unsigned int irSignal[] = {4068, 1028, 2024, 2088, 964}; // vs BATTLE TANK jr T-72 40MHz /* unsigned int irSignal[] = {4048,1068,2048,2008,1044}; vs BATTLE TANK jr エイブラムス 27MHz AnalysIR Batch Export (IRremote) - RAW */ irsend.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), khz);
Serial.begin(115200); while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection if (Usb.Init() == -1) { Serial.print(F("\r\nOSC did not start")); while (1); //halt } Serial.print(F("\r\nPS3 Bluetooth Library Started")); }
Serial.begin(115200); while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection if (Usb.Init() == -1) { Serial.print(F("\r\nOSC did not start")); while (1); //halt } Serial.print(F("\r\nPS3 Bluetooth Library Started")); }
Serial.begin(115200); while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection if (Usb.Init() == -1) { Serial.print(F("\r\nOSC did not start")); while (1); //halt } Serial.print(F("\r\nPS3 Bluetooth Library Started")); }