Browse Source

add Sensoren Dateien

master
Ralf Behrens 4 years ago
parent
commit
8a38809bac
  1. 14
      include/MessenSensoren.h
  2. 64
      src/MessenSensoren.cpp
  3. 2
      src/main.cpp

14
include/MessenSensoren.h

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
#ifndef h_messenSensoren
#define h_messenSensoren
void init_Messen(void);
void MessenSensoren(void);
#endif

64
src/MessenSensoren.cpp

@ -0,0 +1,64 @@ @@ -0,0 +1,64 @@
// Sensoren lesen
#include "MessenSensoren.h"
#include <Wire.h>
#include "myi2c.h"
#include "bme280.h"
#include "bh1750.h"
#define I2C_POWER 5 // bei Feather M0
void init_Messen(void)
{
// I2C Power einschalten LoRa Transponder
pinMode(// I2C Power einschalten LoRa Transponder
pinMode(I2C_POWER,OUTPUT);
digitalWrite(I2C_POWER, HIGH);
delay(10/8);
Wire.begin();
,OUTPUT);
digitalWrite(I2C_POWER, HIGH);
delay(10/8);
Wire.begin();
if ( I2C_Test(BME280_ADR) != 0xFF )
{
Serial.println("BME280 gefunden");
}
if ( I2C_Test(0x77) != 0xFF )
{
Serial.println("BMP180 gefunden");
}
if ( I2C_Test(0x38) != 0xFF )
{
Serial.println(F("AHT10 gefunden"));
}
// such BH1730
if ( I2C_Test(0x29) != 0xFF )
{
Serial.println("BH1730 gefunden");
}
// such BH1750
if ( I2C_Test(0x23) != 0xFF )
{
Serial.println("BH1750 gefunden");
BH1750_Init();
}
}
//--------------------------
void MessenSensoren(void)
{
}

2
src/main.cpp

@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
#include <hal/hal.h>
#include <SPI.h>
#include "hseSensorProtocol.h"
#include "MessenSensoren.h"
//
// For normal use, we require that you edit the sketch to replace FILLMEIN

Loading…
Cancel
Save