abish7643 / esp32cam-i2csensors Goto Github PK
View Code? Open in Web Editor NEWUse TwoWire to Create Custom I2C Bus on an AI-Thinker ESP32Cam & Interface I2C Sensors (BME280).
Use TwoWire to Create Custom I2C Bus on an AI-Thinker ESP32Cam & Interface I2C Sensors (BME280).
Hi, I´m in a learning phase so sometimes simples things appears to be impossile to me, and one of it is: is this library can be used with ADS1115?
The main goal is to connect a rain sensor on ESP32-CAM, as I can´t use analog ports when WiFi is being used this is my (maybe) only option. Is it possible? Is there any example?
Great approach. I was interested in interfacing esp32 ai thinker with MPU6050 sensor which should take a similar approach, but it can't find the mpu6050 chip. I'm adding the code I used for reference. Any help would be greatly appreciated.
// Basic demo for accelerometer readings from Adafruit MPU6050
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>
#define MPU6050_I2C_SDA 13
#define MPU6050_I2C_SCL 14
TwoWire I2Cmpu = TwoWire(0);
Adafruit_MPU6050 mpu;
unsigned long delayTime;
void setup(void) {
Serial.begin(115200);
I2Cmpu.begin(MPU6050_I2C_SDA, MPU6050_I2C_SCL, 100000);
bool status;
status = mpu.begin(0x68, &I2Cmpu);
while (!Serial)
delay(10); // will pause Zero, Leonardo, etc until serial console opens
Serial.println("Adafruit MPU6050 test!");
// Try to initialize!
if (!status) {
Serial.println("Failed to find MPU6050 chip");
while (1) {
delay(10);
}
}
Serial.println("MPU6050 Found!");
mpu.setAccelerometerRange(MPU6050_RANGE_8_G);
Serial.print("Accelerometer range set to: ");
switch (mpu.getAccelerometerRange()) {
case MPU6050_RANGE_2_G:
Serial.println("+-2G");
break;
case MPU6050_RANGE_4_G:
Serial.println("+-4G");
break;
case MPU6050_RANGE_8_G:
Serial.println("+-8G");
break;
case MPU6050_RANGE_16_G:
Serial.println("+-16G");
break;
}
mpu.setGyroRange(MPU6050_RANGE_500_DEG);
Serial.print("Gyro range set to: ");
switch (mpu.getGyroRange()) {
case MPU6050_RANGE_250_DEG:
Serial.println("+- 250 deg/s");
break;
case MPU6050_RANGE_500_DEG:
Serial.println("+- 500 deg/s");
break;
case MPU6050_RANGE_1000_DEG:
Serial.println("+- 1000 deg/s");
break;
case MPU6050_RANGE_2000_DEG:
Serial.println("+- 2000 deg/s");
break;
}
mpu.setFilterBandwidth(MPU6050_BAND_21_HZ);
Serial.print("Filter bandwidth set to: ");
switch (mpu.getFilterBandwidth()) {
case MPU6050_BAND_260_HZ:
Serial.println("260 Hz");
break;
case MPU6050_BAND_184_HZ:
Serial.println("184 Hz");
break;
case MPU6050_BAND_94_HZ:
Serial.println("94 Hz");
break;
case MPU6050_BAND_44_HZ:
Serial.println("44 Hz");
break;
case MPU6050_BAND_21_HZ:
Serial.println("21 Hz");
break;
case MPU6050_BAND_10_HZ:
Serial.println("10 Hz");
break;
case MPU6050_BAND_5_HZ:
Serial.println("5 Hz");
break;
}
Serial.println("");
delay(100);
}
void loop() {
/* Get new sensor events with the readings */
sensors_event_t a, g, temp;
mpu.getEvent(&a, &g, &temp);
/* Print out the values */
Serial.print("Acceleration X: ");
Serial.print(a.acceleration.x);
Serial.print(", Y: ");
Serial.print(a.acceleration.y);
Serial.print(", Z: ");
Serial.print(a.acceleration.z);
Serial.println(" m/s^2");
Serial.print("Rotation X: ");
Serial.print(g.gyro.x);
Serial.print(", Y: ");
Serial.print(g.gyro.y);
Serial.print(", Z: ");
Serial.print(g.gyro.z);
Serial.println(" rad/s");
Serial.print("Temperature: ");
Serial.print(temp.temperature);
Serial.println(" degC");
Serial.println("");
delay(500);
}
Hello '
I am student from Seoul, South Korea and ESP32 starter.
Nowadays I am really enjoying ADRUINO and got many helps from many GURU.
I am trying to connect motion sensor to esp32-cam and I found your amazing materials.
It is really helpful. Unfortunately I am using ADXL-345 so there is little difference.
Which is i am using #include <Adafruit_ADXL345_U.h> while yours is #include <Adafruit_BME280.h>.
because of this difference I can't Initalize the Sensor correctly.
can you tell me the way to solve this problem??
Thanks in advance
SIncerely
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.