2024 DigiKey创意大赛】职场提神法宝项目-ESP32-C6与手机APP进行通讯
[复制链接]
本帖最后由 eew_cT3H5d 于 2024-10-28 07:51 编辑
打开案例库:
修改增加传感器读取代码
String data = 'A' + String(temp.temperature) + 'B' + String(humidity.relative_humidity) + 'C' + String(scd30.CO2, 3)
+'D' + String(sgp.TVOC) + 'E' + String(massConcentrationPm2p5) +'F' + String(vocIndex) +'@';
if (deviceConnected) {
pTxCharacteristic->setValue(data);
pTxCharacteristic->notify();
txValue++;
delay(10); // bluetooth stack will go into congestion, if too many packets are sent
}
APP设计:
代码设计:
调试设计:
|