Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

Commit 9cf3736

Browse files
committed
Add ino file
1 parent d08809d commit 9cf3736

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

HfA/HfA.ino

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#include "BluetoothSerial.h"
2+
3+
String device_name = "SmartHomevision";
4+
5+
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
6+
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
7+
#endif
8+
9+
#if !defined(CONFIG_BT_SPP_ENABLED)
10+
#error Serial Port Profile for Bluetooth is not available or not enabled. It is only available for the ESP32 chip.
11+
#endif
12+
13+
BluetoothSerial SerialBT;
14+
15+
void setup() {
16+
Serial.begin(115200);
17+
SerialBT.begin(device_name);me
18+
Serial.printf("The device with name \"%s\" is started.\nNow you can pair it with Bluetooth!\n", device_name.c_str());
19+
}
20+
21+
void loop() {
22+
if (Serial.available()) {
23+
SerialBT.write(Serial.read());
24+
}
25+
if (SerialBT.available()) {
26+
Serial.write(SerialBT.read());
27+
}
28+
delay(20);
29+
}

HfA/ci.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"targets": {
3+
"esp32c3": false,
4+
"esp32c6": false,
5+
"esp32h2": false,
6+
"esp32s2": false,
7+
"esp32s3": false
8+
}
9+
}

0 commit comments

Comments
 (0)