mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-09-19 16:46:11 -04:00
0.3.6 GY521
This commit is contained in:
parent
4822b5988e
commit
d15be3d8aa
@ -1,7 +1,7 @@
|
||||
//
|
||||
// FILE: GY521.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.3.4
|
||||
// VERSION: 0.3.6
|
||||
// PURPOSE: Arduino library for I2C GY521 accelerometer-gyroscope sensor
|
||||
// URL: https://github.com/RobTillaart/GY521
|
||||
//
|
||||
@ -23,6 +23,7 @@
|
||||
// 0.3.3 2021-07-05 fix #22 improve maths
|
||||
// 0.3.4 2021-07-12 fix #24 improve precision
|
||||
// 0.3.5 2021-10-20 update build-CI, badges + #28 add wakeup to begin().
|
||||
// 0.3.6 2021-12-18 update library.json, license, minor edits
|
||||
|
||||
|
||||
#include "GY521.h"
|
||||
@ -317,3 +318,4 @@ int16_t GY521::_WireRead2()
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// FILE: GY521.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.3.4
|
||||
// VERSION: 0.3.6
|
||||
// PURPOSE: Arduino library for I2C GY521 accelerometer-gyroscope sensor
|
||||
// URL: https://github.com/RobTillaart/GY521
|
||||
//
|
||||
@ -15,7 +15,7 @@
|
||||
#include "Wire.h"
|
||||
|
||||
|
||||
#define GY521_LIB_VERSION (F("0.3.5"))
|
||||
#define GY521_LIB_VERSION (F("0.3.6"))
|
||||
|
||||
|
||||
#ifndef GY521_THROTTLE_TIME
|
||||
|
@ -140,4 +140,6 @@
|
||||
#define GY521_FIFO_R_W 0x74
|
||||
#define GY521_WHO_AM_I 0x75
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2021 Rob Tillaart
|
||||
Copyright (c) 2017-2022 Rob Tillaart
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -5,14 +5,15 @@
|
||||
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/GY521/blob/master/LICENSE)
|
||||
[![GitHub release](https://img.shields.io/github/release/RobTillaart/GY521.svg?maxAge=3600)](https://github.com/RobTillaart/GY521/releases)
|
||||
|
||||
|
||||
# GY521
|
||||
|
||||
Arduino library for I2C GY521 accelerometer-gyroscope sensor a.k.a. MCU-6050
|
||||
Arduino library for I2C GY521 accelerometer-gyroscope sensor a.k.a. MCU-6050.
|
||||
|
||||
|
||||
## Description
|
||||
|
||||
Experimental library for GY521 a.k.a. MCU-6050
|
||||
Experimental library for GY521 a.k.a. MCU-6050.
|
||||
|
||||
Library is work in progress, in fact it is extracted and extended from an old project.
|
||||
It needs to be tested a lot more.
|
||||
@ -68,7 +69,7 @@ AD0 connected to VCC => 0x69
|
||||
- **bool begin()** Returns true if address can be found on I2C bus.
|
||||
- **bool isConnected()** returns true if device can be found on I2C bus.
|
||||
- **void reset()** set all internal values to 0 and throttle time to 10 ms.
|
||||
- **bool wakeUp()**
|
||||
- **bool wakeUp()** idem.
|
||||
|
||||
|
||||
### Throttle
|
||||
@ -122,6 +123,16 @@ Read the register PDF for the specific value and meaning of registers.
|
||||
- **uint8_t getRegister(uint8_t reg)**
|
||||
|
||||
|
||||
## documents
|
||||
|
||||
- check details - MPU-6000-Register-Map1.pdf
|
||||
|
||||
|
||||
## Operation
|
||||
|
||||
See examples, use with care
|
||||
|
||||
|
||||
## Future
|
||||
|
||||
**Should**
|
||||
@ -135,13 +146,3 @@ Read the register PDF for the specific value and meaning of registers.
|
||||
- calibrate sketch could print code snippet to include...
|
||||
- option to read only Accel?
|
||||
- option to read only Gyro?
|
||||
|
||||
## documents
|
||||
|
||||
- check details - MPU-6000-Register-Map1.pdf
|
||||
|
||||
|
||||
## Operation
|
||||
|
||||
See examples, use with care
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
//
|
||||
// FILE: GY521_performance.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.0
|
||||
// PURPOSE: minimal demo
|
||||
// DATE: 2021-06-13
|
||||
|
||||
@ -44,4 +43,6 @@ void loop()
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
// -- END OF FILE --
|
||||
|
||||
// -- END OF FILE --
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
//
|
||||
// FILE: GY521_pitch_roll_yaw.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.0
|
||||
// PURPOSE: demo PRY
|
||||
// PURPOSE: demo pitch roll yaw
|
||||
// DATE: 2020-08-06
|
||||
|
||||
|
||||
@ -32,7 +31,7 @@ void setup()
|
||||
|
||||
sensor.setThrottle();
|
||||
Serial.println("start...");
|
||||
|
||||
|
||||
// set calibration values from calibration sketch.
|
||||
sensor.axe = 0;
|
||||
sensor.aye = 0;
|
||||
|
@ -1,7 +1,6 @@
|
||||
//
|
||||
// FILE: readCalibration.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.0
|
||||
// PURPOSE: read the calibration values / errors for a flat sensor.
|
||||
// DATE: 2020-07-14
|
||||
|
||||
@ -105,7 +104,7 @@ void loop()
|
||||
sensor.gxe += gx * 0.05;
|
||||
sensor.gye += gy * 0.05;
|
||||
sensor.gze += gz * 0.05;
|
||||
|
||||
|
||||
counter++;
|
||||
delay(100);
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
//
|
||||
// FILE: test1.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.0
|
||||
// PURPOSE: minimal demo
|
||||
// PURPOSE: minimal demo to test working of the sensor.
|
||||
// DATE: 2020-07-01
|
||||
|
||||
|
||||
@ -42,6 +41,7 @@ void setup()
|
||||
sensor.gze = 0;
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
sensor.read();
|
||||
|
@ -1,8 +1,7 @@
|
||||
//
|
||||
// FILE: test_2.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.0
|
||||
// PURPOSE: test set/get
|
||||
// PURPOSE: test set/get functions
|
||||
// DATE: 2020-08-06
|
||||
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
# Syntax Coloring Map for GY521
|
||||
# Syntax Colouring Map for GY521
|
||||
|
||||
# Datatypes (KEYWORD1)
|
||||
|
||||
# Data types (KEYWORD1)
|
||||
GY521 KEYWORD1
|
||||
|
||||
|
||||
# Methods and Functions (KEYWORD2)
|
||||
begin KEYWORD2
|
||||
isConnected KEYWORD2
|
||||
@ -39,6 +41,7 @@ setRegister KEYWORD2
|
||||
getRegister KEYWORD2
|
||||
getError KEYWORD2
|
||||
|
||||
|
||||
# Constants (LITERAL1)
|
||||
GY521_LIB_VERSION LITERAL1
|
||||
GY521_THROTTLE_TIME LITERAL1
|
||||
|
@ -15,8 +15,9 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/GY521.git"
|
||||
},
|
||||
"version": "0.3.5",
|
||||
"version": "0.3.6",
|
||||
"license": "MIT",
|
||||
"frameworks": "arduino",
|
||||
"platforms": "*"
|
||||
"platforms": "*",
|
||||
"headers": "GY521.h"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=GY521
|
||||
version=0.3.5
|
||||
version=0.3.6
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino library for GY521 angle measurement
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
unittest_setup()
|
||||
{
|
||||
fprintf(stderr, "GY521_LIB_VERSION: %s\n", (char *) GY521_LIB_VERSION);
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +43,7 @@ unittest_teardown()
|
||||
unittest(test_constructor)
|
||||
{
|
||||
GY521 sensor(0x69);
|
||||
fprintf(stderr, "VERSION: %s\n", (char *) GY521_LIB_VERSION);
|
||||
|
||||
sensor.begin();
|
||||
assertEqual(GY521_OK, sensor.getError());
|
||||
|
||||
@ -97,8 +98,6 @@ unittest(test_get_set_sensitivity)
|
||||
|
||||
unittest(test_constants)
|
||||
{
|
||||
fprintf(stderr, "VERSION: %s\n", (char *) GY521_LIB_VERSION);
|
||||
|
||||
assertEqual(GY521_OK, 0);
|
||||
assertEqual(GY521_THROTTLED, 1);
|
||||
assertEqual(GY521_ERROR_READ, -1);
|
||||
|
Loading…
Reference in New Issue
Block a user