ESP32とPC間でBluetoothを介したシリアル通信をしてみます。
#include <BluetoothSerial.h>
BluetoothSerial SerialBT;
void setup() {
SerialBT.begin("ESP32_bt_test"); //Bluetoothの名前設定
}
void loop() {
SerialBT.println("Hello World!");
delay(1000);
}
書き込めたらPCからBluetoothで接続します。
接続できたらArduinoIDEのシリアルモニタから見てみます。
めちゃ簡単でした。
参考:
0918.jp
blog.goo.ne.jp