Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BluetoothSerial bluetoothSerial;
- Serial.println("Initializing Bluetooth...");
- if(!bluetoothSerial.begin("ESP32", true)) {
- Serial.println("Error initializing Bluetooth");
- } else {
- //bluetoothSerial.enableSSP();
- bluetoothSerial.onConfirmRequest([](uint32_t num_val){
- Serial.println("BT Confirm Request");
- });
- bluetoothSerial.onData([](const uint8_t *buffer, size_t size){
- Serial.println("BT Data");
- });
- bluetoothSerial.onAuthComplete([](boolean success){
- Serial.println("BT AuthComplete");
- });
- bluetoothSerial.setPin("1234");
- }
- ... in loop():
- if(bluetoothSerial.available()) {
- Serial.write(bluetoothSerial.read());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement