通过BLE从我的Bluefruit Feather ESP32发送电池电量

问题描述 投票:0回答:1

我正在使用Bluefruit Feather BLE的官方文档中的this demo,所以我在Arduino IDE的循环中添加了以下内容:

  float measuredvbat = analogRead(VBATPIN); // #define VBATPIN A9
  measuredvbat *= 2; // we divided by 2, so multiply back
  measuredvbat *= 3.3; // Multiply by 3.3V, our reference voltage
  measuredvbat /= 1024; // convert to voltage
  Serial.print("VBat: " ); Serial.println(measuredvbat);

我正在获取值,我想通过BLE发送值,但是我认为我应该使用另一个线程来完成,因为我有更多的代码读取其他接收到的值,但是我不知道这样做的最佳方法。预先感谢!

arduino bluetooth bluetooth-lowenergy battery
1个回答
0
投票

最后,我已经弄清楚了如何阅读它。我在this official thread]中评论了该问题

© www.soinside.com 2019 - 2024. All rights reserved.