Skip to content

Commit c36ca16

Browse files
committed
Initial commit
0 parents  commit c36ca16

File tree

9 files changed

+916
-0
lines changed

9 files changed

+916
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

LICENSE.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
SparkFun License Information
2+
============================
3+
4+
SparkFun uses two different licenses for our files — one for hardware and one for code.
5+
6+
Hardware
7+
---------
8+
9+
**SparkFun hardware is released under [Creative Commons Share-alike 4.0 International](http://creativecommons.org/licenses/by-sa/4.0/).**
10+
11+
Note: This is a human-readable summary of (and not a substitute for) the [license](http://creativecommons.org/licenses/by-sa/4.0/legalcode).
12+
13+
You are free to:
14+
15+
Share — copy and redistribute the material in any medium or format
16+
Adapt — remix, transform, and build upon the material
17+
for any purpose, even commercially.
18+
The licensor cannot revoke these freedoms as long as you follow the license terms.
19+
Under the following terms:
20+
21+
Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
22+
ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
23+
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
24+
Notices:
25+
26+
You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.
27+
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.
28+
29+
30+
Code
31+
--------
32+
33+
**SparkFun code, firmware, and software is released under the MIT License(http://opensource.org/licenses/MIT).**
34+
35+
The MIT License (MIT)
36+
37+
Copyright (c) 2016 SparkFun Electronics
38+
39+
Permission is hereby granted, free of charge, to any person obtaining a copy
40+
of this software and associated documentation files (the "Software"), to deal
41+
in the Software without restriction, including without limitation the rights
42+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
43+
copies of the Software, and to permit persons to whom the Software is
44+
furnished to do so, subject to the following conditions:
45+
46+
The above copyright notice and this permission notice shall be included in all
47+
copies or substantial portions of the Software.
48+
49+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
50+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
51+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
52+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
53+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
54+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
55+
SOFTWARE.

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
SparkFun MS5637 Barometric Pressure Library
2+
===========================================================
3+
4+
![SparkFun Pressure Sensor (Qwiic) - MS5637](https://cdn.sparkfun.com//assets/parts/1/2/8/9/3/14688-Pressure_Sensor__Qwiic__-_MS5637-01.jpg)
5+
6+
[*SparkX Pressure Sensor (Qwiic) - MS5637 (SPX-14688)*](https://www.sparkfun.com/products/14688)
7+
8+
MEMs based barometric pressure sensors are quite common these days. The Qwiic Pressure Sensor with the MS5637 shines by being the most sensitive barometric pressure sensor we have come across. It is capable of detecting the difference in 13cm of air! And the MS5637 is low cost and easy to use.
9+
10+
The Qwiic Pressure Sensor for the MS5637 is a very sensitive, fully calibrated, low power, easy to use barometric pressure sensor capable of detecting a change of as little as 13cm of air! The Qwiic Pressure Sensor is perfect for home weather stations, detecting changes in altitude, and pneumatic based switches or actuators.
11+
12+
The original manufacturer TE has written a great Arduino library for the device. We've added a heap of examples and new functions to make the sensor even easier to use. Search the Arduino Library manager for 'SparkFun MS5637' to get the latest library features.
13+
14+
Repository Contents
15+
-------------------
16+
17+
* **/examples** - Example sketches for the library (.ino). Run these from the Arduino IDE.
18+
* **/src** - Source files for the library (.cpp, .h).
19+
* **keywords.txt** - Keywords from this library that will be highlighted in the Arduino IDE.
20+
* **library.properties** - General library properties for the Arduino package manager.
21+
22+
Documentation
23+
--------------
24+
25+
* **[Installing an Arduino Library Guide](https://learn.sparkfun.com/tutorials/installing-an-arduino-library)** - Basic information on how to install an Arduino library.
26+
* **[Product Repository](https://github.com/sparkfunX/Qwiic_IMU_BNO080)** - Main repository (including hardware files)
27+
28+
License Information
29+
-------------------
30+
31+
This product is _**open source**_!
32+
33+
Please use, reuse, and modify these files as you see fit. Please maintain attribution to SparkFun Electronics and release anything derivative under the same license.
34+
35+
Distributed as-is; no warranty is given.
36+
37+
- Your friends at SparkFun.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
Proximity Sensing with the VCNL4040 IR based sensor
3+
By: Nathan Seidle
4+
SparkFun Electronics
5+
Date: April 17th, 2018
6+
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware License).
7+
8+
This example outputs the IR Proximity Value from the VCNL4040 sensor.
9+
10+
Hardware Connections:
11+
Attach the Qwiic Shield to your Arduino/Photon/ESP32 or other
12+
Plug the sensor onto the shield
13+
Serial.print it out at 9600 baud to serial monitor.
14+
15+
TODO:
16+
Set IR current to low/high
17+
is something there?
18+
Power on/off different parts of sensor
19+
output ambient light and white
20+
Set thresholds and print when it's close/far, dark/light
21+
fast i2c / wire port
22+
possibly convert log scale reading to linear distance
23+
*/
24+
25+
#include <Wire.h>
26+
27+
#include "SparkFun_VCNL4040_Arduino_Library.h"
28+
VCNL4040 distanceSensor;
29+
30+
void setup()
31+
{
32+
Serial.begin(9600);
33+
Serial.println("Hello, world!");
34+
35+
Wire.begin(); //Join i2c bus
36+
37+
if (distanceSensor.begin() == false)
38+
{
39+
Serial.println("Device not found. Please check wiring.");
40+
while (1); //Freeze!
41+
}
42+
}
43+
44+
void loop()
45+
{
46+
//Get proximity value. The value ranges from 0 to 65535
47+
//so we need an unsigned integer or a long.
48+
unsigned int proxValue = distanceSensor.getProximity();
49+
50+
Serial.print("Proximity Value: ");
51+
Serial.print(proxValue);
52+
Serial.println();
53+
54+
delay(10);
55+
}
56+
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
Proximity Sensing with the VCNL4040 IR based sensor
3+
By: Nathan Seidle
4+
SparkFun Electronics
5+
Date: April 17th, 2018
6+
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware License).
7+
8+
This example takes an initial reading at power on. If the reading changes
9+
by a significant amount the sensor reports that something is present.
10+
11+
Point the sensor up and start the sketch. Then bring your hand infront of the sensor.
12+
13+
Hardware Connections:
14+
Attach the Qwiic Shield to your Arduino/Photon/ESP32 or other
15+
Plug the sensor onto the shield
16+
Serial.print it out at 9600 baud to serial monitor.
17+
*/
18+
19+
#include <Wire.h>
20+
21+
#include "SparkFun_VCNL4040_Arduino_Library.h"
22+
VCNL4040 distanceSensor;
23+
24+
long startingProxValue = 0;
25+
boolean nothingThere = false;
26+
// http://librarymanager/All#SparkFun_Simultaneous_RFID_Tag_Reader_Library
27+
28+
void setup()
29+
{
30+
Serial.begin(9600);
31+
Serial.println("Hello, world!");
32+
33+
Wire.begin(); //Join i2c bus
34+
35+
if (distanceSensor.begin() == false)
36+
{
37+
Serial.println("Device not found. Please check wiring.");
38+
while (1); //Freeze!
39+
}
40+
41+
//Set the current used to drive the IR LED - 50mA to 200mA is allowed.
42+
distanceSensor.setLEDCurrent(200); //For this example, let's do max.
43+
44+
//The sensor will average readings together by default 8 times.
45+
//Reduce this to one so we can take readings as fast as possible
46+
distanceSensor.setProxIntegrationTime(8); //1 to 8 is valid
47+
48+
//Take 8 readings and average them
49+
for(byte x = 0 ; x < 8 ; x++)
50+
{
51+
startingProxValue += distanceSensor.getProximity();
52+
}
53+
startingProxValue /= 8;
54+
}
55+
56+
void loop()
57+
{
58+
unsigned int proxValue = distanceSensor.getProximity();
59+
60+
Serial.print("Prox: ");
61+
Serial.print(proxValue);
62+
Serial.print(" ");
63+
64+
//Let's only trigger if we detect a 100 value change from the starting value
65+
//Otherwise, values at the edge of the read range can cause false triggers
66+
if(proxValue > (startingProxValue + 100))
67+
{
68+
Serial.print("Something is there!");
69+
nothingThere = false;
70+
}
71+
else
72+
{
73+
if(nothingThere == false) Serial.print("I don't see anything");
74+
nothingThere = true;
75+
}
76+
77+
Serial.println();
78+
delay(10);
79+
}
80+

keywords.txt

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#######################################
2+
# Syntax Coloring Map
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
9+
VCNL4040 KEYWORD1
10+
11+
#######################################
12+
# Methods and Functions (KEYWORD2)
13+
#######################################
14+
15+
VCNL4040 KEYWORD2
16+
begin KEYWORD2
17+
isConnected KEYWORD2
18+
setIRDutyCycle KEYWORD2
19+
setProxInterruptPersistance KEYWORD2
20+
setAmbientInterruptPersistance KEYWORD2
21+
setProxIntegrationTime KEYWORD2
22+
setAmbientIntegrationTime KEYWORD2
23+
powerOnProximity KEYWORD2
24+
powerOffProximity KEYWORD2
25+
powerOnAmbient KEYWORD2
26+
powerOffAmbient KEYWORD2
27+
setProxResolution KEYWORD2
28+
enableAmbientInterrupts KEYWORD2
29+
disableAmbientInterrupts KEYWORD2
30+
enableSmartPersistance KEYWORD2
31+
disableSmartPersistance KEYWORD2
32+
enableActiveForceMode KEYWORD2
33+
disableActiveForceMode KEYWORD2
34+
takeSingleProxMeasurement KEYWORD2
35+
enableWhiteChannel KEYWORD2
36+
disableWhiteChannel KEYWORD2
37+
enableProxLogicMode KEYWORD2
38+
disableProxLogicMode KEYWORD2
39+
setLEDCurrent KEYWORD2
40+
setProxCancellation KEYWORD2
41+
setALSHighThreshold KEYWORD2
42+
setALSLowThreshold KEYWORD2
43+
setProxHighThreshold KEYWORD2
44+
setProxLowThreshold KEYWORD2
45+
getProximity KEYWORD2
46+
getAmbient KEYWORD2
47+
getWhite KEYWORD2
48+
getID KEYWORD2
49+
setProxInterruptType KEYWORD2
50+
isClose KEYWORD2
51+
isAway KEYWORD2
52+
isLight KEYWORD2
53+
isDark KEYWORD2
54+
readCommand KEYWORD2
55+
readCommandLower KEYWORD2
56+
readCommandUpper KEYWORD2
57+
writeCommand KEYWORD2
58+
writeCommandLower KEYWORD2
59+
writeCommandUpper KEYWORD2
60+
bitMask KEYWORD2
61+
62+
#######################################
63+
# Constants (LITERAL1)
64+
#######################################
65+
66+
SPARKFUN_VCNL4040_ARDUINO_LIBRARY_H LITERAL1

library.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=SparkFun MS5637 Barometric Pressure Library
2+
version=1.0.0
3+
author=TE Connectivity and SparkFun Electronics
4+
maintainer=SparkFun Electronics
5+
sentence=Library for the SparkFun Qwiic Pressure Sensor - MS5637
6+
paragraph=The SparkFun breakout board for the MS5637 is a very sensitive, fully calibrated, low power, easy to use barometric pressure sensor capable of detecting a change of as little as 13cm of air! Great for weather sensing and local altimetry projects.
7+
category=Sensors
8+
url=https://github.com/sparkfun/SparkFun_MS5637_Arduino_Library
9+
architectures=*

0 commit comments

Comments
 (0)