Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinyu-Zhao committed May 10, 2023
0 parents commit 96b0347
Show file tree
Hide file tree
Showing 22 changed files with 34,320 additions and 0 deletions.
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# BMI270_Sensor

## Overview

Allows you to read the accelerometer, magnetometer and gyroscope values from the combo BMI270+BMM150 IMU on your ESP32.
30 changes: 30 additions & 0 deletions examples/IMU/IMU.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <Arduino.h>
#include <BMI270_Sensor.h>

I2C_IMU IMU;

/* After ESP32 is started or reset the program in the setUp()
function will be run, and this part will only be run once.
在 ESP32启动或者复位后,即会开始执行setup()函数中的程序,该部分只会执行一次。
*/
void setup() {
USBSerial.begin(115200);
USBSerial.flush();
delay(1500);
Wire1.begin(12, 11, 100000UL);
IMU.Init(); // Init IMU. 初始化IMU
}

/* After the program in setup() runs, it runs the program in loop()
The loop() function is an infinite loop in which the program runs repeatedly
在setup()函数中的程序执行完后,会接着执行loop()函数中的程序
loop()函数是一个死循环,其中的程序会不断的重复运行 */
void loop() {
IMU.Update(); // Update data from IMU. 更新IMU数据
USBSerial.printf("\nAcc_X = %4.2f\t Acc_Y = %4.2f\t Acc_Z = %4.2f\n",
IMU.accel_data.x, IMU.accel_data.y, IMU.accel_data.z);
USBSerial.printf("\nGyro_X = %4.2f\t Gyro_Y = %4.2f\t Gyro_Z = %4.2f\n\n",
IMU.gyro_data.x, IMU.gyro_data.y, IMU.gyro_data.z);

delay(10);
}
16 changes: 16 additions & 0 deletions library.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "BMI270_Sensor",
"description": "Library for BMI270 sensor",
"keywords": "BMI270 BMM150 IMU",
"authors": {
"name": "Tinyu",
"url": "https://github.com/Tinyu-Zhao/"
},
"repository": {
"type": "git",
"url": "https://github.com/Tinyu-Zhao/BMI270_Sensor.git"
},
"version": "0.0.1",
"frameworks": "arduino",
"platforms": "espressif32"
}
11 changes: 11 additions & 0 deletions library.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name=BMI270_Sensor
version=0.0.1
author=Tinyu
maintainer=Tinyu
sentence=Library for BMI270 sensor
paragraph=See more on https://github.com/Tinyu-Zhao/BMI270_Sensor
category=Device Control
url=https://github.com/Tinyu-Zhao/BMI270_Sensor
architectures=esp32
includes=BMI270_Sensor.h
depends=M5CoreS3
8 changes: 8 additions & 0 deletions src/BMI270_Sensor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef _BMI270_SENSOR_H_
#define _BMI270_SENSOR_H_

#include <Wire.h>
#include "bmi270.h"
#include "bmm150.h"

#endif
Loading

0 comments on commit 96b0347

Please sign in to comment.