Skip to content

Commit a42a513

Browse files
authored
Prints negative TEMP big endian as just 2 bytes
1 parent 0980a21 commit a42a513

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/BLE/examples/BLE_EddystoneTLM_Beacon/BLE_EddystoneTLM_Beacon.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void setBeacon()
5252
float tempFloat = random(-3000, 3000) / 100.0f;
5353
Serial.printf("Random temperature is %.2f°C\n", tempFloat);
5454
int temp = (int)(tempFloat * 256);
55-
Serial.printf("Converted to 8.8 format 0x%04X\n", temp);
55+
Serial.printf("Converted to 8.8 format %0X%0X\n", (temp >> 8) & 0xFF, (temp & 0xFF));
5656

5757
BLEAdvertisementData oAdvertisementData = BLEAdvertisementData();
5858
BLEAdvertisementData oScanResponseData = BLEAdvertisementData();

0 commit comments

Comments
 (0)