
1.1.ARDUINO IDE
Visit Arduino's official website(https: / / www.arduino.cc/ en/ Main/ Software),Select the installation package for your own operating system to download.
> 1.Open up Arduino I DE, navigate to ` File` -> ` Peferences` -> ` Settings`
> 2.Copy the following M5Stack Boards Manager url to ` Additional Boards Manager URLs: `
> 3.Navigate to ` Tools` -> ` Board: ` -> ` Boards Manager...`
> 4.Search ` ESP32` in the pop-up window, find it and click ` Install`
> 5.select ` Tools` -> ` Board: ` -> ` ESP32-Arduino-ESP32 DEV Module


Open the Arduino I DE and open the example program ` File` -> ` Examples` -> ` BluetoothSerial` -> ` SerialToSerialBT` . Connect the device to the computer and select the corresponding port to burn. After completion, the device will automatically run Bluetooth, and the device name is ` ESP32test` . At this time, use the Bluetooth serial port sending tool on the PC to realize the transparent transmission of Bluetooth serial data.

#include "BluetoothSerial.h"
#if!defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED) #error Bluetooth is not enabled! Please run `make menuconfig` to and en able it #endif

void setup() {
Serial.begin(115200); SerialBT.begin("ESP32test"); //Bluetooth device name Serial.println("The device started, now you can pair it with bluetoot h!"); }
void loop() {
if (Serial.available()) {
SerialBT.write(Serial.read()); } if (SerialBT.available()) {
Serial.write(SerialBT.read()); } delay(20); }
Open the Arduino I DE and open the example program ` File` -> ` Examples` -> ` WiFi` -> ` WiFiScan` . Connect the device to the computer and select the corresponding port to burn. After completion, the device will automatically run the WiFi scan, and the current WiFi scan result can be obtained through the serial port monitor that comes with the Arduino.

BluetoothSerial SerialBT;

#include "WiFi.h"
void setup() {
Serial.begin(115200); // Set WiFi to station mode and disconnect from an AP if it was pre viously connected
WiFi.mode(WIFI_STA); WiFi.disconnect(); delay(100);
Serial.println("Setup done"); }
void loop() {
Serial.println("scan start");
// WiFi.scanNetworks will return the number of networks found int n = WiFi.scanNetworks(); Serial.println("scan done"); if (n == 0) {
Serial.println("no networks found"); } else {
Serial.print(n); Serial.println(" networks found"); for (int i = 0; i < n; ++i) {
// Print SSID and RSSI for each network found Serial.print(i + 1); Serial.print(": "); Serial.print(WiFi.SSID(i)); Serial.print(" ("); Serial.print(WiFi.RSSI(i)); Serial.print(")"); Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN)?" ":"*");
delay(10); } } Serial.println("");
// Wait a bit before scanning again delay(5000); }
Besitzer und unser Team antworten in der Regel innerhalb eines Tages – und Ihre Frage hilft auch anderen weiter.
Stellen Sie die erste Frage — andere Nutzer oder unser Team antworten Ihnen.