ヘタなの買うより安いですね。

Arduino をフレームワークにした場合これだけです。

// main.ino
#include "BluetoothSerial.h"

BluetoothSerial SerialBT;

void setup() {
	Serial.begin(115200);
	SerialBT.begin("ESP32");
}

void loop() {
	if (SerialBT.available()) {
		Serial.write(SerialBT.read());
	}
	if (Serial.available()) {
		SerialBT.write(Serial.read());
	}
}
  1. トップ
  2. tech
  3. ESP32 を BLE SPP / UART 変換器にする