| Electronic Components Datasheet Search |
|
DEV-13956 Datasheet(PDF) 4 Page - SparkFun Electronics |
|
|
|||||||||||||||||||||||||||||
DEV-13956 Datasheet(HTML) 4 Page - SparkFun Electronics |
|
4 / 26 page ![]() /* Weather Shield Example By: Nathan Seidle SparkFun Electronics Date: June 10th, 2016 License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license). This example prints the current humidity, air pressure, tempe rature and light levels. The weather shield is capable of a lot. Be sure to checkout t he other more advanced examples for creating your own weather station. Updated by Joel Bartlett 03/02/2017 Removed HTU21D code and replaced with Si7021 */ #include <Wire.h> //I2C needed for sensors #include "SparkFunMPL3115A2.h" //Pressure sensor Search "Spa rkFun MPL3115" and install from Library Manager #include "SparkFun_Si7021_Breakout_Library.h" //Humidity senso r Search "SparkFun Si7021" and install from Library Manager MPL3115A2 myPressure; //Create an instance of the pressure sen sor Weather myHumidity;//Create an instance of the humidity sensor //Hardware pin definitions //============================ const byte STAT_BLUE =7; const byte STAT_GREEN =8; const byte REFERENCE_3V3 = A3; const byte LIGHT = A1; const byte BATT = A2; //Global Variables //============================ long lastSecond; //The millis counter to see when a second rol ls by void setup() { Serial.begin(9600); Serial.println("Weather Shield Example"); pinMode(STAT_BLUE, OUTPUT); //Status LED Blue pinMode(STAT_GREEN, OUTPUT); //Status LED Green pinMode(REFERENCE_3V3, INPUT); pinMode(LIGHT, INPUT); //Configure the pressure sensor myPressure.begin(); // Get sensor online myPressure.setModeBarometer(); // Measure pressure in Pascal s from 20 to 110 kPa myPressure.setOversampleRate(7); // Set Oversample to the re commended 128 myPressure.enableEventFlags(); // Enable all three pressure and temp event flags Page 4 of 26 |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |