Bluegiga蓝牙低功耗:通过Arduino UART读取数据

时间:2015-05-17 17:00:33

标签: bluetooth arduino bluetooth-lowenergy uart bluegiga

我需要在两个BLE设备之间进行通信 - 一个充当发送者而另一个充当收集者。我正在使用Bluegiga BLE 113 breakout board bought from a third party store

Bluegiga对我发送的发送方和接收方BLE的闪烁示例代码有article。现在的问题是,我如何确定这两个BLE之间的数据通信是否真的有效?

如果您检查Bluegiga文章,您将看到指令#5"将UART设备连接到UART1 / Alt1引脚,以查看过程所有阶段的UART状态输出。"这意味着将Bluegiga RX连接到Arduino TX,反之亦然。

  1. 通过多个Bluegiga支持电子邮件,我确保连接 正确的针脚。
  2. 确保BLE获得3.3V电源
  3. 在Arduino下面的代码中使用以读取UART,但串行监视器中没有显示任何内容。
  4. 编辑:我注意到Arduino TX,RX引脚没有闪烁。这意味着Arduino没有收到Bluegiga的UART引脚上的任何东西?

    我错过了什么?

    int incomingByte = 0;   // for incoming serial data
    
    void setup () {
        Serial.begin(115200); }
    
    void loop() {
    
        // send data only when you receive data:
        if (Serial.available() > 0) {
                // read the incoming byte:
                incomingByte = Serial.read();
    
                // say what you got:
                Serial.print("I received: ");
                Serial.println(incomingByte, DEC);
        }
    }
    

0 个答案:

没有答案
相关问题