forked from bareboat-necessities/bbn_esp32_sensors_hub
-
Notifications
You must be signed in to change notification settings - Fork 0
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
26 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
#ifndef gpio_240_30_ohm_sensor_h | ||
#define gpio_240_30_ohm_sensor_h | ||
|
||
#include "ResistanceSensor.h" | ||
#include "NmeaXDR.h" | ||
|
||
#define Resistance_Sensor_GPIO_PIN G8 | ||
|
||
ResistanceSensor resistanceSens; | ||
|
||
void gpio_240_30_ohm_sensor_report() { | ||
ResistanceSensor_read(&resistanceSens); | ||
gen_nmea0183_xdr("$BBXDR,G,%.1f,O,Ohms_esp32", resistanceSens.measured_resistance); | ||
} | ||
|
||
void gpio_240_30_ohm_try_init() { | ||
// for 240-30 Ohm sensors (USA standard). Good for 0-180 Ohm too (EU Standard). | ||
ResistanceSensor_init(&resistanceSens, Resistance_Sensor_GPIO_PIN, DOWNSTREAM, 3.3, 100.0); | ||
app.onRepeat(5000, []() { | ||
gpio_240_30_ohm_sensor_report(); | ||
}); | ||
} | ||
|
||
#endif |
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