
nRF51822_OBS + mocro:bit_ADV
Dependencies: mbed BLE_API Adafruit_GFX nRF51822
Тесты по созданию связи между micro:bit и nRF51822 & BLE400 эта часть под nRF51822
Diff: main.cpp
- Revision:
- 13:ae46f7a91beb
- Parent:
- 12:0f6e700ca698
- Child:
- 14:985bfbee997b
--- a/main.cpp Sun Dec 15 13:50:21 2019 +0000 +++ b/main.cpp Sun Dec 15 14:37:04 2019 +0000 @@ -78,12 +78,16 @@ pc.printf("From [%02x %02x %02x %02x %02x %02x], ", params->peerAddr[5], params->peerAddr[4], params->peerAddr[3], params->peerAddr[2], params->peerAddr[1], params->peerAddr[0]); if(params->peerAddr[0] == 0x38) { pc.printf("Temp is %.02f\r", (float)pAppData->tmpSensorValue); - gOled2.setTextCursor(1, 16); + gOled2.setTextCursor(4, 16); gOled2.setTextSize(2); gOled2.printf("Temp: %.01f", (float)pAppData->tmpSensorValue); gOled2.display(); } else { pc.printf("XZ is %.02f\r", (float)pAppData->tmpSensorValue); + gOled2.setTextCursor(4, 32); + gOled2.setTextSize(2); + gOled2.printf("XZ: 0x%02xh", pAppData->tmpSensorValue); + gOled2.display(); } // pc.printf(" ButtonAB is %02x", pAppData->btnA_Value); // pc.printf("%02x\r", pAppData->btnB_Value); @@ -108,8 +112,10 @@ pc.printf("Observer Init \r\n"); gOled2.clearDisplay(); + gOled2.drawRect(0, 0, 127, 63, 1); + gOled2.drawRect(1, 1, 125, 61, 1); gOled2.display(); - gOled2.setTextCursor(1, 1); + gOled2.setTextCursor(4, 4); gOled2.setTextSize(1); gOled2.printf("Observer Init \r"); gOled2.display();