Skip to content

Commit ddd6496

Browse files
committed
Changed data type of temperature
1 parent 23d715a commit ddd6496

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/BLE/examples/BLE_Beacon_Scanner/BLE_Beacon_Scanner.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks
115115
foundEddyURL.setData(eddyContent);
116116
Serial.printf("Reported battery voltage: %dmV\n", foundEddyURL.getVolt());
117117
Serial.printf("Reported temperature from TLM class: %.2fC\n", (double)foundEddyURL.getTemp());
118-
int temp = (int)payLoad[16] + (int)(payLoad[15] << 8);
118+
int16_t temp = (int16_t)payLoad[16] + (int16_t)(payLoad[15] << 8);
119119
float calcTemp = temp / 256.0f;
120120
Serial.printf("Reported temperature from data: %.2fC\n", calcTemp);
121121
Serial.printf("Reported advertise count: %d\n", foundEddyURL.getCount());

0 commit comments

Comments
 (0)