-
Notifications
You must be signed in to change notification settings - Fork 497
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
libraries/nrfx_examples/examples/nrfx_temp_non-blocking/nrfx_temp_non-blocking.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
This is example usage of the nrfx_temp driver | ||
*/ | ||
|
||
#include <nrfx_temp.h> | ||
#include <Adafruit_TinyUSB.h> | ||
|
||
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)); | ||
} | ||
|
||
void setup() { | ||
Serial.begin(9600); | ||
nrfx_temp_init(&config, &temp_handler); | ||
} | ||
|
||
void loop() { | ||
nrfx_temp_measure(); | ||
|
||
delay(1000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name=nrfx examples | ||
version=1.0 | ||
author=Neotje | ||
maintainer=Neotje <neotje111@gmail.com> | ||
sentence=Examples for the Adafruit nRF52 Arduino platform using nrfx | ||
paragraph=Examples for the Adafruit nRF52 Arduino platform using nrfx | ||
category=other | ||
url=https://github.com/adafruit/Adafruit_nRF52_Arduino | ||
architectures=* |