Skip to content

Commit

Permalink
move example to Bluefruit52Lib/Hardware, update example with float fo…
Browse files Browse the repository at this point in the history
…r readability
  • Loading branch information
hathach committed Nov 30, 2023
1 parent a71a669 commit 145041c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ void setup() {
void loop() {
nrfx_temp_measure(); // In blocking mode: this function waits until the measurement is finished.
int32_t raw_temp = nrfx_temp_result_get();
Serial.println(nrfx_temp_calculate(raw_temp));
float temp_c = raw_temp / 4.0;

Serial.print(temp_c);
Serial.println(" C");

delay(1000);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ nrfx_temp_config_t config = NRFX_TEMP_DEFAULT_CONFIG;

// this function is called when the temperature measurement is ready
void temp_handler(int32_t raw_temp) {
Serial.println(nrfx_temp_calculate(raw_temp));
float temp_c = raw_temp / 4.0;
Serial.print(temp_c);
Serial.println(" C");
}

void setup() {
Expand Down
9 changes: 0 additions & 9 deletions libraries/nrfx_examples/library.properties

This file was deleted.

0 comments on commit 145041c

Please sign in to comment.