Skip to content

Commit

Permalink
Fix negative temperatures
Browse files Browse the repository at this point in the history
  • Loading branch information
agvxov committed Nov 22, 2018
1 parent 4968d16 commit d82e0d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flora/flora.ino
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ bool readFloraDataCharacteristic(BLERemoteService* floraService, String baseTopi
}
Serial.println(" ");

float temperature = (val[0] + val[1] * 256) / ((float)10.0);
int16_t* temp_raw = (int16_t*)val;
float temperature = (*temp_raw) / ((float)10.0);
Serial.print("-- Temperature: ");
Serial.println(temperature);

Expand Down

0 comments on commit d82e0d0

Please sign in to comment.