-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for SPL06_007 Temperature & Pressure I2C (+10k2 code) (#…
…21185) * Adds support for SPL06_007 (+10k2 code) * removes not so used methods. Removes -2kb * change doubles to floats * fixes a name * change sns idx to 25
- Loading branch information
Showing
13 changed files
with
742 additions
and
3 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
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
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,7 @@ | ||
# SPL06-007 | ||
Ardino SPL06-007 Library | ||
|
||
This is a work in progress to create a working Arduino library for the SPL06-007 pressure sensor. I am able to get the coefficents, pressure, and temperature readings from the sensor. Need to convert to a standard Arduino library format. Code was developed and tested on an ESP32 microcontroller. | ||
|
||
Link to datasheet | ||
https://datasheet.lcsc.com/szlcsc/1912111437_Goertek-SPL06-007_C233787.pdf |
Binary file added
BIN
+1.45 MB
lib/lib_i2c/SPL06_007/datasheets/1912111437_Goertek-SPL06-007_C233787.pdf
Binary file not shown.
119 changes: 119 additions & 0 deletions
119
lib/lib_i2c/SPL06_007/examples/Pressure_Info/Pressure_Info.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,119 @@ | ||
#include <SPL06-007.h> | ||
#include <Wire.h> | ||
|
||
//#define Serial SerialUSB | ||
|
||
void setup() { | ||
Wire.begin(); // begin Wire(I2C) | ||
Serial.begin(115200); // begin Serial | ||
|
||
Serial.println("\nGoertek-SPL06-007 Demo\n"); | ||
|
||
SPL_init(); // Setup initial SPL chip registers - default i2c address 0x76 | ||
// SPL_init(0x77); // Uncomment for alternate I2C address 0x77 | ||
} | ||
|
||
void loop() { | ||
|
||
// ---- Register Values ---------------- | ||
Serial.print("ID: "); | ||
Serial.println(get_spl_id()); | ||
|
||
Serial.print("PRS_CFG: "); | ||
Serial.println(get_spl_prs_cfg(),BIN); | ||
|
||
Serial.print("TMP_CFG: "); | ||
Serial.println(get_spl_tmp_cfg(),BIN); | ||
|
||
Serial.print("MEAS_CFG: "); | ||
Serial.println(get_spl_meas_cfg(),BIN); | ||
|
||
Serial.print("CFG_REG: "); | ||
Serial.println(get_spl_cfg_reg(),BIN); | ||
|
||
Serial.print("INT_STS: "); | ||
Serial.println(get_spl_int_sts(),BIN); | ||
|
||
Serial.print("FIFO_STS: "); | ||
Serial.println(get_spl_fifo_sts(),BIN); | ||
|
||
|
||
// ---- Coefficients ---------------- | ||
Serial.print("c0: "); | ||
Serial.println(get_c0()); | ||
|
||
Serial.print("c1: "); | ||
Serial.println(get_c1()); | ||
|
||
Serial.print("c00: "); | ||
Serial.println(get_c00()); | ||
|
||
Serial.print("c10: "); | ||
Serial.println(get_c10()); | ||
|
||
Serial.print("c01: "); | ||
Serial.println(get_c01()); | ||
|
||
Serial.print("c11: "); | ||
Serial.println(get_c11()); | ||
|
||
Serial.print("c20: "); | ||
Serial.println(get_c20()); | ||
|
||
Serial.print("c21: "); | ||
Serial.println(get_c21()); | ||
|
||
Serial.print("c30: "); | ||
Serial.println(get_c30()); | ||
|
||
|
||
// ---- Temperature Values ---------------- | ||
Serial.print("traw: "); | ||
Serial.println(get_traw()); | ||
|
||
Serial.print("traw_sc: "); | ||
Serial.println(get_traw_sc(),3); | ||
|
||
Serial.print("Temperature: "); | ||
Serial.print(get_temp_c()); | ||
Serial.println(" C"); | ||
|
||
Serial.print("Temperature: "); | ||
Serial.print(get_temp_f()); | ||
Serial.println(" F"); | ||
|
||
|
||
// ---- Pressure Values ---------------- | ||
Serial.print("praw: "); | ||
Serial.println(get_praw()); | ||
|
||
Serial.print("praw_sc: "); | ||
Serial.println(get_praw_sc(),3); | ||
|
||
Serial.print("pcomp: "); | ||
Serial.println(get_pcomp(),2); | ||
|
||
Serial.print("Measured Air Pressure: "); | ||
Serial.print(get_pressure(),2); | ||
Serial.println(" mb"); | ||
|
||
|
||
// ---- Altitude Values ---------------- | ||
double local_pressure = 1011.3; // Look up local sea level pressure on google // Local pressure from airport website 8/22 | ||
Serial.print("Local Airport Sea Level Pressure: "); | ||
Serial.print(local_pressure,2); | ||
Serial.println(" mb"); | ||
|
||
Serial.print("altitude: "); | ||
Serial.print(get_altitude(get_pressure(),local_pressure),1); | ||
Serial.println(" m"); | ||
|
||
Serial.print("altitude: "); | ||
Serial.print(get_altitude_f(get_pressure(),local_pressure),1); // convert from meters to feet | ||
Serial.println(" ft"); | ||
|
||
|
||
|
||
Serial.println("\n"); | ||
delay(2000); | ||
} |
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,57 @@ | ||
####################################### | ||
# Syntax Coloring Map For SHT21 | ||
####################################### | ||
|
||
####################################### | ||
# Datatypes (KEYWORD1) | ||
####################################### | ||
|
||
SPL06-007 KEYWORD1 | ||
|
||
####################################### | ||
# Methods and Functions (KEYWORD2) | ||
####################################### | ||
|
||
SPL_init KEYWORD2 | ||
get_spl_id KEYWORD2 | ||
get_spl_prs_cfg KEYWORD2 | ||
get_spl_tmp_cfg KEYWORD2 | ||
get_spl_meas_cfg KEYWORD2 | ||
get_spl_cfg_reg KEYWORD2 | ||
get_spl_int_sts KEYWORD2 | ||
get_spl_fifo_sts KEYWORD2 | ||
|
||
get_traw KEYWORD2 | ||
get_traw_sc KEYWORD2 | ||
get_temp_c KEYWORD2 | ||
get_temperature_scale_factor KEYWORD2 | ||
|
||
|
||
get_pressure_scale_factor KEYWORD2 | ||
get_pcomp KEYWORD2 | ||
get_praw_sc KEYWORD2 | ||
get_praw KEYWORD2 | ||
get_pressure KEYWORD2 | ||
|
||
get_c0 KEYWORD2 | ||
get_c1 KEYWORD2 | ||
get_c00 KEYWORD2 | ||
get_c10 KEYWORD2 | ||
get_c01 KEYWORD2 | ||
get_c11 KEYWORD2 | ||
get_c20 KEYWORD2 | ||
get_c21 KEYWORD2 | ||
get_c30 KEYWORD2 | ||
i2c_eeprom_write_uint8_t KEYWORD2 | ||
i2c_eeprom_read_uint8_t KEYWORD2 | ||
|
||
####################################### | ||
# Instances (KEYWORD2) | ||
####################################### | ||
|
||
|
||
|
||
|
||
####################################### | ||
# Constants (LITERAL1) | ||
####################################### |
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,11 @@ | ||
name=SPL06-007 | ||
version=0.1.0 | ||
author=rv701 | ||
maintainer=rv701 | ||
sentence=SPL06-007 library for Arduino processors | ||
paragraph=Supports SPL06-007 I2C pressure sensor. | ||
category=Sensors | ||
url=https://github.com/rv701/SPL06-007 | ||
architectures=* | ||
includes=SPL06-007.h | ||
|
Oops, something went wrong.