Giter Club home page Giter Club logo

bme280-lcd20x4's Introduction

bme280-lcd20x4

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>

#define SEALEVELPRESSURE_HPA (1013.25)
byte degree[8] = { 0b00011, 0b00011, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000 };
Adafruit_BME280 bme;
LiquidCrystal_I2C lcd(0x27, 20,4);
void setup() { Serial.begin(9600); if (!bme.begin(0x76)) { Serial.println("No se pudo encontrar un sensor BME280 válido, verifique el cableado!"); while (1); } lcd.init(); lcd.init(); lcd.backlight(); lcd.createChar(1, degree); }
void loop() { Serial.print("Temperatura = "); Serial.print(bme.readTemperature()); Serial.println("*C");
Serial.print("Humedad = "); Serial.print(bme.readHumidity()); Serial.println("%");
Serial.print("Presion = "); Serial.print(bme.readPressure() / 100.0F); Serial.println("hPa");
Serial.print("Altitud = "); Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA)); Serial.println("m");

lcd.setCursor(0, 0); lcd.print("Temperatura: "); lcd.print(bme.readTemperature()); lcd.write(1); lcd.print("C");

lcd.setCursor(0, 1); lcd.print("Humedad: "); lcd.print(bme.readHumidity()); lcd.print("%");

lcd.setCursor(0, 2); lcd.print("Presion: "); lcd.print(bme.readPressure() / 100.0F); lcd.print("hPa");

lcd.setCursor(0, 3); lcd.print("Altitud: "); lcd.print(bme.readAltitude(SEALEVELPRESSURE_HPA)); lcd.print("m");

Serial.println(); delay(1000); lcd.clear(); }

bme280-lcd20x4's People

Contributors

paulpopaul avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.