基于LinkNode的机器人手臂状态监视器的设计

(bmp180.getPressure(&pressure) != 0) { printf("Error getting pressure\n"); continue; } printf("Pressure = %d Pa Temperature = %f C\n", pressure, temp); wait(1); }}

将这个程序按照上面所述下载到芯片上面,就能够查看到温度了。

然后进行蓝牙通讯实验。实验的代码如下:

#include <mbed.h>#include <ble/BLE.h>#include <ble/services/UARTService.h>#define NEED_CONSOLE_OUTPUT 0#if NEED_CONSOLE_OUTPUT#define DEBUG(...) { printf(__VA_ARGS__); }#else#define DEBUG(...)#endifBLEDevice  ble;DigitalOut led1(LED1);UARTService *uartServicePtr;void disconnectionCallback(const Gap::DisconnectionCallbackParams_t *params){    DEBUG("Disconnected!\n\r"