3 changed files with 79 additions and 1 deletions
@ -0,0 +1,14 @@ |
|||||||
|
#ifndef h_messenSensoren |
||||||
|
#define h_messenSensoren |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void init_Messen(void); |
||||||
|
void MessenSensoren(void); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif |
||||||
@ -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) |
||||||
|
{ |
||||||
|
|
||||||
|
} |
||||||
Loading…
Reference in new issue